question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Calendar's "today" date is not updated

See original GitHub issue

This is a simple issue so I though of not creating any demo.

If you have the calendar open in week view in an application, and you visit the application the next day, it shows the current date as the day before (or the date you visited application the last time). While the current time marker is somehow at the right place and the actual date.

It makes sense though, as the current time update code runs in an interval function so it will have proper value. It also makes sense that current date (today) is calculated only once and will not update until the view refreshes.

I’m not sure if there can be any fix for this but one solution that may work would be to check current date while updating the current time. And if any change is required then update the current date.

For people facing same issue would be to force update the view which will allow FC to recalculate everything (simple way would be to provide refresh button for users to handle it manually).

Note: I have not tested it out in day/month views. And week view here refers only to agendaWeek view. My assumption is the problem will stand in all kind of views.

Issue Analytics

  • State:open
  • Created 6 years ago
  • Reactions:6
  • Comments:11 (1 by maintainers)

github_iconTop GitHub Comments

4reactions
marcoanconacommented, Mar 22, 2021

Any update on this? Still an issue with Fullcalendar 5.

Edit: in the meanwhile, I found this workaround, which is not too ugly:

 const [currentDate, setCurrentDate] = useState<string>(moment().format('YYYY-MM-DD'));

 // Trigger update of the component on date change
  useEffect(() => {
    setInterval(() => {
        setCurrentDate(moment().format("YYYY-DD-MM"););
    }, 1000 * 60);
  }, []);

return (<FullCalendar
        key={currentDate}
        ...
</FullCalendar>)

1reaction
marcoanconacommented, Dec 21, 2017

I would be also interested in a workaround. I can handle the timer in the app logic, but is there a method in the public fullcalendar API that would trigger the update?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Calendar 2022 - Time and Date
Calendars – online and print friendly – for any year and month and including public holidays and observances for countries worldwide.
Read more >
mini Calendar dates is not updating automatically as per ...
When I opened the website it was showing the current date as 05-05-2021 and according to this date, it is showing today's event...
Read more >
google calendar doesn't open on today's date
google calendar doesn't open on today's date. When I open my Google calendar in Chrome (on Windows 10) it opens in a different...
Read more >
Outlook Calendar Not Updating - Microsoft Community
My outlook calendar is not updating properly when using the app on my laptop. When viewing shared calendars, they are not up to...
Read more >
calendar view not refreshing · Issue #726 · wix/react-native ...
Make sure that markedDates param is immutable. If you change markedDates object content but the reference to it does not change calendar update ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found