I’m trying to set the date in the scale of a custom timeline “Day” view. I would like it to start from the first day of the month to the last day of the month every time I click on the next, previous, today, and day buttons.
Here is an image of what it looks like
I would like the scale to show from may 01 to may 31. But it shows from may 17 to june 15.
This is what I have so far but it does not change the dates.
scheduler.attachEvent("onBeforeViewChange", function (old_mode, old_date, mode, date) {
if (mode === 'dtimeline') {
if (old_date.getTime() === date.getTime() && old_mode === mode)
return false;
let d = scheduler.getState().date;
let minDate = scheduler.getState().min_date;
let maxDate = scheduler.getState().max_date;
scheduler.setCurrentView(d);
}
if (old_date) {
if (+date > +old_date) {//scroll forward
} else if (+date < +old_date) {//scroll backward
}
}
return true;
});