vkurko / calendar

Full-sized drag & drop JavaScript event calendar with resource & timeline views
https://vkurko.github.io/calendar/
MIT License
964 stars 82 forks source link

issue with firstDay in combination with duration #206

Closed gwleuverink closed 7 months ago

gwleuverink commented 7 months ago

I've been tinkering around with this library and find it very easy to use so far! I'm experimenting with this to see if it's a viable alternative for a different library I use right now & in my experimentations noticed a little quirk.

I use the timeGridWeek view.

When I use the option firstDay: 1 to start the week at monday everything works fine.

But when I want to hide weekends (with the duration: { days: 5 } option) It correctly renders only 5 days, but starts the week on a sunday again. The firstDay option seems to be ignored.

options: {
    view: 'timeGridWeek',
    slotDuration: '00:15:00', // Drag in steps of 15 minutes
    duration: { days: 5 }, // Display with or without weekend
    nowIndicator: true,
    allDaySlot: false,
    selectable: true,
    firstDay: 1, // Start on Monday
}
vkurko commented 7 months ago

If you want to hide some days of the week, then use hiddenDays option for this. Duration is something different.

gwleuverink commented 7 months ago

Thanks for the speedy reply. That seems to do it 👍