'Fullcalendar V5 slotMinTime doesn't work for me
I try to make slotMinTime and slotMaxTime on my Fullcalendar v5 but nothing is displayed. My Fullcalendar already start to 00:00:00 (default). I try to follow this https://fullcalendar.io/docs/slotMinTime but I can not
document.addEventListener('DOMContentLoaded', () => {
var calendarEl = document.getElementById('calendar-holder');
var calendar = new FullCalendar.Calendar(calendarEl, {
dateClick: function(info) {
window.location.href = "http://127.0.0.1:8000/booking/new/" + info.dateStr;
},
validRange: {
start: new Date(),
end: '2022-06-01'
},
defaultView: 'timeGridWeek',
slotMinTime: "07:00",
allDaySlot: false,
editable: true,
duration: '01:00',
eventSources: [
{
url: "{{ path('fc_load_events') }}",
method: "POST",
extraParams: {
filters: JSON.stringify({})
},
failure: () => {
// alert("There was an error while fetching FullCalendar!");
},
},
],
header: {
left: 'prev,next today',
center: 'title',
right: 'timeGridWeek',
},
buttonText: {
timeGridWeek:'semaine',
today:'aujourd\'hui'
},
plugins: [ 'interaction', 'dayGrid', 'timeGrid' ], // https://fullcalendar.io/docs/plugin-index
timeZone: 'Europe/Paris',
locale: 'fr',
eventDrop: function(drop) {
window.location.href = "http://127.0.0.1:8000" + drop.event.url + "/edit/" + drop.event._instance.range.start + "/" + drop.event._instance.range.end;
},
});
calendar.render();
});
Solution 1:[1]
Your problem is that you are using FullCalendar v4, not v5

Change your original code to from slotMinTime to minTime and slotMaxTime to maxTime and it'll work!
Continue using your v4 files, and use
slotMinTime: "07:00",
slotMaxTime: "18:00",
or, upgrade your JS File references to v5, and use
slotMinTime: "07:00",
slotMaxTime: "18:00",
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Mike Irving |



