Hi Team,
I am always getting this error on change of date from today, forward or next.
My tbar config is:-
tbar = {
[
{
type: 'combo',
value: timelineView,
editable: false,
ref: 'viewPresetCombo',
cls: 'select-view',
listCls: 'list-items',
listeners: { change: viewPresetHandler },
items: getTimeLineViewList()
},
{
type: 'dateField',
editable: false,
cls: 'date-field',
onChange ({ value, userAction }) {
if(hasSchedulerInstance() && userAction) {
limitMonthRange(value);
const diff = DateHelper.diff(
DateHelper.clearTime(getSchedulerInstance().startDate),
value,
'days'
);
const updatedStartDate = DateHelper.add(
getSchedulerInstance().startDate,
diff,
'days'
);
getSchedulerInstance().startDate = updatedStartDate;
getSchedulerInstance().scrollToDate(value, {
block: getViewPosition()
});
}
},
listeners: {
trigger: onDatePickerLoad
},
ref: 'selectDate'
},
{
type: 'button',
text: 'L{todayText}',
onClick () {
const today = DateHelper.clearTime(new Date());
if(hasSchedulerInstance() &&
!DateHelper.isEqual(today, getSchedulerInstance().startDate, 'days')) {
limitMonthRange(today);
const diff = DateHelper.diff(
DateHelper.clearTime(getSchedulerInstance().startDate),
today,
'days'
);
const updatedStartDate = DateHelper.add(
getSchedulerInstance().startDate,
diff,
'days'
);
getSchedulerInstance().startDate = updatedStartDate;
getSchedulerInstance().scrollToDate(today, {
block: getViewPosition()
});
}
},
cls: 'btn-today'
},
{
type: 'button',
icon: 'b-fa-angle-left',
cls: 'btn-prev',
onClick () {
if(hasSchedulerInstance()) {
getSchedulerInstance().shiftPrevious();
}
}
},
{
type: 'button',
icon: 'b-fa-angle-right',
cls: 'btn-next',
onClick () {
if(hasSchedulerInstance()) {
getSchedulerInstance().shiftNext();
}
}
},
'->'
]
}
Now if I click 'btn-next', 'btn-prev' and today or any other combination like next today, prev then the above error is coming.I have attached the screenshot fo the reference.