Using Year View; Event added into first day of month also shows in last day +1 of previous month on some occasions. EG event: 29 Feb 2024 is OK, event:1 Mar 2024 shows as 30 Feb 2024 AND 1 Mar 2024.
Using sample code with an event generator:
// Generate daily event accumulators
var DateGen = new DayPilot.Date.parse("2024-01-01", "yyyy-MM-dd");
var DateMax = new DayPilot.Date.parse("2025-01-01", "yyyy-MM-dd");
while (DateGen < DateMax) {
if ([1, 2, 3, 4, 5].includes(DateGen.dayOfWeek())) { // Check if it's a weekday
var e = {
start: DateGen.addHours(7),
end: DateGen.addHours(15),
text: ""
};
console.log(e, DateGen.dayOfWeek());
events.push({
...e,
...{
id: DayPilot.guid(),
backColor: "rgba(162,41,40,0.50)"
}
});
events.push({
...e,
...{
id: DayPilot.guid(),
backColor: "rgba(162,41,40,0.40)"
}
});
}
DateGen = DateGen.addDays(1);
}
dp.update({
resources,
events,
startDate
});