Skip to content
Advertisement

Fullcalendar returning wrong date on dayClick()

Trying to get the dayClick() callback to get the current date. Instead, no matter what I do it seems to return YESTERDAY and even shows the wrong day of the week (i.e. it will say “Friday” when the actual day matching the date is Saturday). One really strange thing to note is that this ONLY seems to happen when I click dates around "today" (i.e. the highlighted date), sometimes it corrects itself, other times… not.

Here is my JS:

JavaScript

And my HTML:

JavaScript

And finally, the console log that shows when I click 12/4/15 (date of this post):

JavaScript

What is wrong here? What steps can I take to ensure this does not happen in the future? Thank you!

Advertisement

Answer

For some reason adding the “next” and “prev” buttons in the header resolves the issue. No clue why. Hope this helps anyone else having this problem in the future.

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