Trying to get a dayspan event to happen regardless if it is over a month or year boundary every nth day. This following snippet shows the boundary problem over a month where I want the event to occur on the 1st of August. I could change it to dayOfYear however the problem may happen on the 1st of Jan. Any help would be much appreciated.
var cal = ds.Calendar.days(6,ds.Day.build(2019, ds.Month.JULY, 31));
cal.addEvent({
id: 'someUserProvidedId',
data: " - Every second day",
schedule: new ds.Schedule({
dayOfMonth: {every: 2,offset: 0},
start: ds.Day.build(2019, ds.Month.JULY, 29),
end: ds.Day.build(2019, ds.Month.AUGUST, 28),
})
});
cal.days.forEach((i) => {
console.log(i.format("ddd, MMM Do YYYY"));
i.events.forEach((j) => {
console.log(j.event.data);
});
});
<script src="https://cdn.jsdelivr.net/npm/dayspan@1.1.0/dist/dayspan.min.js"></script>
from Dayspan JS get an event to happen every second day
No comments:
Post a Comment