FullCalendar Scheduler - gotoDate within current view

407 views Asked by At

I have a view as follows:

type: 'timelineYear',
duration: {days: 365},
buttonText: 'Next 12 Months',
slotLabelInterval: { days: 1 },
slotLabelFormat: [
     'MMMM YYYY', // top level of text
      'DD[\n]dd'   // lower level of text
]

Which shows the next 365 days from a specific date (defaulted to todays date in the initialiser).

When using gotoDate if the date is already present in the view nothing happens, it should change so that the first date in the view is the selected date. If the date is not within the view then it changes correctly.

For example, upon loading the calendar shows dates from 2017-01-09 to 2018-01-08, the user selects 2017-09-05 from a date picker control and I call gotoDate with this date, nothing happens.

My current solution is to first go to an extrem date then go to the date I want to display:

$("#calendar").fullCalendar('gotoDate', new Date("2000-01-01"));          
$("#calendar").fullCalendar('gotoDate', d);

However this is slow because the calendar has to refetch the events twice.

0

There are 0 answers