Today button disable for current month. when you go next or previous month it appear as active(when click on the TODAY button control goes to current month).
In following code I am showing how to make today button active for current month.
function makeTodaybtnActive()
{
$('#calendar button.fc-today-button').removeAttr('disabled');
$('#calendar button.fc-today-button').removeClass('fc-state-disabled');
}
(where #calendar is fullcalendar id)
call this function when calendar load
$(window).load(function() {
makeTodaybtnActive();
});
Also in eventRender
function
$('#calendar').fullCalendar({
eventRender: function(event, element) {
makeTodaybtnActive();
},
});
When calendar load (page load) that time first code work and when change the month and goes to current month (by clicking today button) then second code make Today button active.
The 'today' button is made inactive automatically when today's date is visible in the rendered calendar area since there is no point in jumping to 'today' if it is already visible. If you really wish it to be always enabled it is possible https://jsfiddle.net/73b7rva6/
In
FullCalendar
, Today button is disabled automatically when we are on Today's date. please check below code.Today button disable for current month. when you go next or previous month it appear as active(when click on the TODAY button control goes to current month).
In following code I am showing how to make today button active for current month.
(where #calendar is fullcalendar id)
call this function when calendar load
Also in
eventRender
functionWhen calendar load (page load) that time first code work and when change the month and goes to current month (by clicking today button) then second code make Today button active.