Skip to content
Advertisement

Full Calendar does not show range for 15 min slot duration

enter image description hereI am fixing someone else’s code and I’m not familiar with Full calendar. Can anybody help me with full calendar. I have an event set for 7:00AM-7:15AM, it should show that on the UI. What happens right now is that whenever I set to 15 mins duration the UI only shows the start time e.g. 7:00AM but if I select 30 mins or higher it shows the full duration e.g. 7:00AM-7:30AM.

Here’s snippet of the controller.js

        weekends: true,
        //eventBackgroundColor: component.get('v.eventBackgroundColor'),
        eventBorderColor: component.get('v.eventBorderColor'),
        eventTextColor: component.get('v.eventTextColor'),
        slotDuration: '00:15:00',
        slotLabelInterval: 15,
        slotLabelFormat: 'h:mm a',
        minTime: "7:00:00",
        maxTime: "20:15:00",
        timezone: "Australia/Melbourne",            
        views: {
            workWeekView: {
                type: 'agendaWeek',
                duration: {
                    days: 7
                },
                title: 'Apertura',
                columnFormat: 'dddd', // Format the day to only show like 'Monday'
                hiddenDays: [0, 6] // Hide Sunday and Saturday?
            }
        },

Advertisement

Answer

The rule seems to be that if the event’s duration is less than or equal to the length of the slot duration, it won’t show the end date.

e.g. if the slotDuration is 30 minutes (the default) then any events whose duration is 30 minutes or less will not display the end time in the agenda view.

I thought that displayEventEnd might be able to override it, but that is already true by default for agenda views.

Demo: https://codepen.io/ADyson82/pen/vYeqdjo

There doesn’t appear to be any way to change this behaviour in fullCalendar 3, unfortunately.

However if you upgrade to the (currently) latest fullCalendar – version 5 – then it’s already the default behaviour to show the event end time in all cases, no matter the duration of the event.

Demo: https://codepen.io/ADyson82/pen/mdBZXQy

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement