Skip to content
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

agenda: Fixed "Today" and "Yesterday" wrongly displayed for allDay events on some time zones #2857

Merged
merged 1 commit into from
Jul 3, 2023

Conversation

glemco
Copy link
Contributor

@glemco glemco commented Jul 2, 2023

The way we were comparing the date for Today and Yesterday was to compute the ISOstring, extract the date and compare that with today's. Such date is however in UTC and allDay events start at midnight, which makes them belong to the previous day on half of the time zones (the same problem could appear on other events earlier than the time zone's offset).
With this PR we compare day and month, which is safer as it should take into consideration also time zones.

Fixes: #2856

@gfwilliams
Copy link
Member

Nice - thanks! That's a pain though - I wonder if that hits us in other places too where we use ISOstring

@gfwilliams gfwilliams merged commit 8b5fd6f into espruino:master Jul 3, 2023
1 check passed
@glemco
Copy link
Contributor Author

glemco commented Jul 3, 2023

I would say so, if it's trimmed to check the date, it can definitely give +1 or -1 days depending on the time and timezone..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[agenda] Wrong label for Today in allday events
2 participants