Hi, i am using https://framework7.io/docs/calendar.html
I added some events to the calendar and i wonder can i get all events from the clicked day (ie all events from 01-02-2021) from dayClick event listener? Or do i need to code it myself?
app.calendar.create({
containerEl: '#calendar-inline-container',
events: [
{
date: new Date(2021, 1, 11),
color: '#0000FF'
},
{
date: new Date(2021, 2, 13),
color: '#0000FF'
},
],
value: [new Date()],
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);
},
dayClick: (date) => {
//DAYCLICK, date is whole calendar object
console.log(date);
}
}
});
the variable date in dayClick is a whole object calendar and i found out that it contains all events in params > events
Any help will be appreciated