FullCalendar - Different minTime / maxTime for different days -
is there way set different mintime / maxtime different days?
eg:
mon, starttime: 09:00, endtime: 19:00
tue, starttime: 10:00, endtime: 20:00
...
sat, starttime: 09:00, endtime: 13:00
i realise bit old now, able achieve setting mintime , maxtime options after initialisation based on events. believe feature came available in later release (i'm using v3.1.0).
in scenario, when user clicks on day, set start time , end time based on day of week is. created map/dict of open , close times each day:
// create map of iso day , start , end times // eg. 1 = monday, 2 = tuesday etc var openclosetimes = { // monday 1: { starttime: '09:00:00', endtime: '17:00:00' }, // tuesday 2: { starttime: '09:00:00', endtime: '17:00:00' }, // wednesday 3: { starttime: '09:00:00', endtime: '17:00:00' }, // thursday 4: { starttime: '09:00:00', endtime: '17:00:00' }, // friday 5: { starttime: '09:00:00', endtime: '17:00:00' }, // saturday 6: { starttime: '10:00:00', endtime: '16:00:00' }, // sunday 7: { starttime: '10:00:00', endtime: '16:00:00' } }
and in dayclick function:
dayclick: function( date, jsevent, view) { // day of week integer // eg. 1 = monday, 2 = tuesday var dayofweek = date.day(); $('.calendar').fullcalendar('option','mintime', openclosetimes[dayofweek].start_time); $('.calendar').fullcalendar('option','maxtime', openclosetimes[dayofweek].end_time); }
Comments
Post a Comment