My issue lies with the implementation of fullCalendar. Specifically, I am utilizing the week view (defaultView: 'basicWeek') with the toolbar buttons for 'today', 'prev', and 'next'. The problem arises when I click the 'today' button - the calendar navigates back to the current week, but the date selection remains unchanged. What I want is for the calendar to not only navigate to the current week but also automatically select today's date on the calendar. However, I am encountering difficulties in redefining the 'today' button click event.
Sample code can be found here: https://plnkr.co/edit/dv9yiq1CdJxfFTsDg4Yx?p=preview
defaultView: 'basicWeek',
defaultDate: '2016-01-12',
selectable: true,
selectHelper: true,
select: function(start, end) {
console.log('select');
var title = prompt('Event Title:');
var eventData;
if (title) {
eventData = {
title: title,
start: start,
end: end
};
$('#calendar').fullCalendar('renderEvent', eventData, true);
}
$('#calendar').fullCalendar('unselect');
}
In this scenario, I would like a popup (alert) to appear showing today's date when I click the 'today' button. Essentially, I want the button click event not just to navigate me to the current week but also to auto-select the current day.