New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Incorrect dates passed to daygridMonth header #5854
Comments
Thanks, confirmed. You demo doesn't run for me but I get the same in the basic debug template: |
As hard as it is to believe, this behavior is intentional. The headers above the dates in month view do not belong to any of the individual days below them. They are "timeless" in a way. They do not rerender when the month changes either. To make clear the fact that they are not linked to a current-month date, I made their dates in the render-hook in the distant past. What are you hoping to render in the headers? Something date-specific? |
I would expect it to work the same as v4. Here is forked v4 component sandbox with enabled If it's intended change then you can close the issue, it just looks like a bug. |
Thanks @l3szcz , it is intended, but I'll make a task to update the docs |
@arshaw but how to highlight a header in a I want to set some background color if it's today. And it works perfectly in |
@l3szcz I know its been a long time since you reported this issue but did you get any solution because I have the same problem? |
No, at our company we determined that the functionality is not that important to look for a workaround or push FullCalendar team to reverse the change. |
@acerix hi Dylan, did you you guys found the issue or a solution for this ticket? |
How can we correct this? It's not clear and the bug has been detected few months ago with services pack and it still doesn't work. |
Same issue, we customized the grid header of month view with this hook, however, we always get
The week view looks good for the parameters:
I checked the source code and fullcalendar has the below logic for month view. The text output is correct by the dateEnv format.
|
Just find the fullcalendar actually get the text by calling formatDate from @fullcalendar/common and it eventually equals to the below codes:
Therefore, I found my solution now. |
Reduced Test Case
REDUCED TEST CASE.
Bug Description
Describe how to recreate the bug.
Use props
dayHeaderFormat
ordayHeaderContent
to change header display ondaygridMonth
. In both cases the date passed to those functions is incorrect - points to Jan 1970.What do you expect to happen?
Correct date should be passed to formatting/rendering functions just like in the other views.
What happens instead?
Incorrect date is passed - it's always Jan 1970.
The text was updated successfully, but these errors were encountered: