With calendar version 1.x, I added events I used:
calendarInline.params.events=eventos; // eventos is an array with dates
And now with version 3.4.0, using:
calendarInline.events = eventos; // eventos is an array with dates
The calendar does not show the dots:
If I do this:
app.dialog.alert(calendarInline.events);
The events are in the calendar, but no dots apear. I try calendarInline.update(); but it does not work either.
What am I doing wrong?
manuweb
2
If i do this:
var calendarInline=app.calendar.create({
containerEl: '#calendar-agenda',
value: [new Date()],
events: [ {date:new Date(2018,9,14)},{date:new Date(2018,9,16)}],
weekHeader: false,
renderToolbar: function () {
return '<div class="toolbar calendar-custom-toolbar no-shadow">' +
'<div class="toolbar-inner">' +
'<div class="left">' +
'<a href="#" class="link icon-only"><i class="icon icon-back ' + (app.theme === 'md' ? 'color-black' : '') + '"></i></a>' +
'</div>' +
'<div class="center"></div>' +
'<div class="right">' +
'<a href="#" class="link icon-only"><i class="icon icon-forward ' + (app.theme === 'md' ? 'color-black' : '') + '"></i></a>' +
'</div>' +
'</div>' +
'</div>';
},
on: {
init: function (c) {
$$('.calendar-custom-toolbar .center').text(monthNames[c.currentMonth] +', ' + c.currentYear);
$$('.calendar-custom-toolbar .left .link').on('click', function () {
calendarInline.prevMonth();
});
$$('.calendar-custom-toolbar .right .link').on('click', function () {
calendarInline.nextMonth();
});
},
monthYearChangeStart: function (c) {
$$('.calendar-custom-toolbar .center').text(monthNames[c.currentMonth] +', ' + c.currentYear);
},
}
});
Calendar show both dots!!
But if i delete line “events:,” and if I put this after calendar create:
calendarInline.events=[ {date:new Date(2018,9,14)},{date:new Date(2018,9,16)}];
calendarInline.update();
No dots are showed!!
must be
calendarInline.params.events=
Thanks Vladimir!! I do not know where I had read that in this version the events were called directly. It works now.