[feat]Restrict fullcalendar to display time from the start hour to end hour of a conference

This commit is contained in:
Jimmy 2021-04-30 17:33:16 +08:00 committed by CactusPuppy
parent e9145f8940
commit 657c9fdfb8
No known key found for this signature in database
GPG key ID: 4B33B0A3E15E2C82
2 changed files with 5 additions and 1 deletions

View file

@ -4,7 +4,10 @@ $( document ).ready(function() {
let fullcalData = $('#fullcalendar');
var calendar = new FullCalendar.Calendar(calendarEl, {
expandRows: true,
allDaySlot: false,
slotMinTime: fullcalData.data('startHour') + ':00:00',
slotMaxTime: fullcalData.data('endHour') + ':00:00',
timeZone: 'UTC', // TODO: Events are stored in conference's timezone implicitly (UTC+0) in the database
initialDate: fullcalData.data('day'),
initialView: 'resourceTimeGridDay',

View file

@ -6,4 +6,5 @@
= @conference.title
#vert-schedule-full-calendar
#fullcalendar{ data: { rooms: @rooms, events: @event_schedules, day: @day } }
#fullcalendar{ data: { rooms: @rooms, events: @event_schedules, day: @day, |
'start-hour': @conference.start_hour, 'end-hour': @conference.end_hour } }