Hi to all
I try to implement a Today functionality using a custom link in the date picker footer area.
But method update() doesn’t work properly when I’m in a different month. So the date changed to current date but the UI doesn’t turn to the current month/date on the screen
my Code:
var dateFrom = app.calendar.create({
inputEl: '#dateFrom',
dateFormat: 'dd-mm-yyyy',
header: true,
footer: true,
closeOnSelect: true,
openIn: 'customModal',
on: {
open(calendar) {
calendar.$el.find('.calendar-footer').prepend(`<a class="link today-link" style="margin-right: auto">TODAY</a>`);
calendar.$el.find('.today-link').off('click').on('click', function () {
var todayval= [];
todayval[0] = new Date();
calendar.setValue([todayval[0]]);
calendar.update();
})
}
}
});
Is that a bug or do I have to change something?
BR
Dimitris