This might be due to my brain being slow this morning but I can't seem to get the Custom Initial Date to work. I am using 8.x-1.x-dev and FullCalendar 3.10.0 - but it doesn't appear to work regardless of the date chosen. I have a few Drupal 7 websites with FullCalendar and the initial date works on those installs.

Any help would be appreciated!

Comments

Shane Birley created an issue. See original summary.

ryankavalsky’s picture

+1 This doesn't seem to be working for me, either. 8.x-1.0-alpha3

ryankavalsky’s picture

In case this helps anybody else, I've found a way to set the initial date using JS called from $(document).ready():

// Get all current events, sorted earliest to latest
var arrEvents = $(".fullcalendar").fullCalendar("clientEvents");
arrEvents.sort();

// Determine if we have to go to the first event, last event, or stay on the current date
var intFirstEvent = arrEvents[0].start;
var intLastEvent = arrEvents[arrEvents.length - 1].start;
var intCurrentDate = Date.now();
if (intCurrentDate < intFirstEvent)
	$(".fullcalendar").fullCalendar("gotoDate", intFirstEvent);
else if (intCurrentDate > intLastEvent)
	$(".fullcalendar").fullCalendar("gotoDate", intLastEvent);
dcam’s picture

Status: Active » Closed (outdated)

I've volunteered to help clean up the FullCalendar issue queue. As part of that effort I'm closing issues open for unsupported versions of the module as "Closed (outdated)".

If this issue is still relevant for version 3.x of FullCalendar, then feel free to re-open it and update the issue version number.