fullcalendar / fullcalendar

Full-sized drag & drop event calendar in JavaScript
https://fullcalendar.io
MIT License
18.59k stars 3.61k forks source link

Navigation breaks with `resourceTimelineMonth` and `dateAlignment: "week"` #7541

Open XrmGuru opened 11 months ago

XrmGuru commented 11 months ago

Reduced Test Case

https://codepen.io/XrmGuru/pen/zYeJOaY

Do you understand that if a reduced test case is not provided, we will intentionally delay triaging of your ticket?

Which connector are you using (React/Angular/etc)?

React

Bug Description

We want to have a Resource Planner view what start at the first day of the week. With the dateAlignment we managed that. But when you move to the next month it isn't working, when you go to the previous month it get stuck. It seems like a bug.

Steps to reproduce:

  1. set the view or custom view on resourceTimelineMonth
  2. add the line dateAlignment: "week" to start at the first day of the week
  3. click the header right or left button
acerix commented 11 months ago

Thanks for the report, it does seem like a bug since the navigation breaks, and similar to https://github.com/fullcalendar/fullcalendar/issues/5319 which was resolved.

I think the issue is that the number of days in the month is ambiguous when multiple months are being displayed. Setting a fixed number of days works:

https://codepen.io/acerix/pen/qBgJXGL?editors=0010

You could also replace the buttons with customButtons to override how they work like in this example:

https://codepen.io/acerix/pen/vYgMxvO?editors=001

XrmGuru commented 10 months ago

Thx for the quick reaction and the good workaround!!