Hello,
I created this custom interval to navigate from month to month on year view but when changing year it breaks the header text.
Here is an example below as you can see when i changed years it broke the Header text and went back to the start of 2021 instead of resetting to 2022 Jan. I gave the view the max months for testing.
here is the code i created to achieve this.
var n = d.getMonth();
var tmz = Intl.DateTimeFormat().resolvedOptions().timeZone;
scheduleObj2 = new ej.schedule.Schedule({
width: '380px', height: '680px',
firstMonthOfYear: n,
monthsCount: 100,
timezone: tmz,
currentView: 'Year',
views: [{ option: 'Year' }],
eventSettings: {
dataSource: [],
},
actionBegin: function (args) {
debugger;
if (args.requestType === 'toolbarItemRendering') {
var Mprevbut = {
align: 'Right', showTextOn: 'Both', prefixIcon: 'e-icon-prev', id: 'MPrev',
text: '', type: 'Button', click: MonthPrev
};
args.items.push(Mprevbut);
var Mnextbut = {
align: 'Right', showTextOn: 'Both', prefixIcon: 'e-icon-next', id: 'MNext',
text: '', type: 'Button', click: MonthNext
};
args.items.push(Mnextbut);
}
}
});
scheduleObj2.appendTo('#scheduler2');
function MonthNext() {
var x = scheduleObj2.firstMonthOfYear + 1;
console.log(x);
scheduleObj2.firstMonthOfYear = x;
}
function MonthPrev() {
var x = scheduleObj2.firstMonthOfYear - 1;
console.log(x);
scheduleObj2.firstMonthOfYear = x;
}