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

The date in the dayHeaderContent arg repeats the previous day on the day after a time change using Luxon #7633

Open
1 task done
tusharnaresh opened this issue Mar 18, 2024 · 2 comments

Comments

@tusharnaresh
Copy link

Reduced Test Case

https://stackblitz.com/edit/github-aecao6-cxsktn?file=src%2FDemoApp.jsx

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

  • I understand

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

React

Bug Description

Getting 30 March date twice for Asia/Beirut timezone when using luxon plugin to format the date. The DST shift will happen on the Asia/Beirut timezone at 31st March 2024 12 am. The offset becomes ftom GMT+2 to GMT+3.
image

@acerix
Copy link
Member

acerix commented Mar 19, 2024

Thanks for the report. I can confirm this seems to be a bug in the Luxon plugin. I updated the demo to show the time and can see it's one hour behind on the day after the time change which causes the date from the previous day to repeat:

https://stackblitz.com/edit/github-aecao6-5bitnh?file=src%2FDemoApp.jsx

As a workaround, you could detect if the date is a duplicate of the previous one, and in that case, add one hour to change it to the next day. Here's an example:

https://stackblitz.com/edit/github-aecao6-tup5w2?file=src%2FDemoApp.jsx

@acerix acerix changed the title Getting duplicated date in week view when using luxon plugin for Asia/Beirut timezone The date in the dayHeaderContent arg repeats the previous day on the day after a time change using Luxon Mar 19, 2024
@tusharnaresh
Copy link
Author

We are currently creating another dateTime object from the current date by adding 1 hour. We are then checking if the current dateTime object doesn't lie in DST and the new dateTime object lies in DST(using the isInDST property on the luxon date time object). If that's the case we adjust the current date with the difference of offsets between the two objects. This seems to give proper result for timezones that have DST activated at 12 AM. This is a workaround, would really appreciate a proper fix for this.
https://stackblitz.com/edit/github-aecao6-cxsktn?file=src%2FDemoApp.jsx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Todo
Development

No branches or pull requests

3 participants