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

Date decrease by 1day while formatting dates greater than 2037 for the timezones which have DayLightSaving #945

Closed
SanthoshYAR opened this issue Jun 21, 2021 · 6 comments

Comments

@SanthoshYAR
Copy link

SanthoshYAR commented Jun 21, 2021

0.5.32### Moment-timezone version which you use:

Version:

Note: many issues are resolved if you just upgrade to the latest version

Issue description:

When a date is formatted using moment js and if the year is greater than 2037 and the corresponding timezone has DST, date is formatted 1 day less

@SanthoshYAR SanthoshYAR changed the title Date decrease by 1 while formatting dates after 2038 in en_US locale Date decrease by 1 while formatting dates after 2038 for the timezones which have DayLightSaving Jul 1, 2021
@SanthoshYAR SanthoshYAR changed the title Date decrease by 1 while formatting dates after 2038 for the timezones which have DayLightSaving Date decrease by 1day while formatting dates greater than 2037 for the timezones which have DayLightSaving Jul 1, 2021
@ichernev
Copy link
Contributor

Can you please provide exact examples, expected, actual results. Normally moment-timezone releases have DST info up until 2037 (well some have until 23xx but this is a bug : #768).

@mangeshwalhe
Copy link

Hello,
We are facing this issue. Requirement needs user to add a future date (date of retirement, lease end date), which in many usecases is beyond 1st January 2038. It is registered in GMT format, hence when users from APAC region add a date, it is rendered as previous date.
May I know the timeline planned for fixing this issue?

@wiznotwiz
Copy link

Bump - any updates here?

My use case is that I'm comparing dates to see if they're quarter-end dates. Unfortunately, after 2037, only Dec 31 is matching (while Mar 31, Jun 30, and Sept 30) are not matching. I'm not using time to check - only month # and day #. But, for example, 09/30/2039 is being seen as 09/28/2039 when using the moment(_date_).date() utility function. Note that .date() is working perfectly for finding my quarter-end dates until I pass in dates after Dec 2037 (i.e. 03/31/2038 doesn't get recognized as a quarter-end date).

@gilmoreorless
Copy link
Member

The last few Moment Timezone releases (since 0.5.37) have increased the data range well past 2038. Can you try with the latest version and see if you're still having these issues?

@wiznotwiz
Copy link

wiznotwiz commented Jan 20, 2023

That's good to know - we will look into upgrading Moment when we update packages this year! We're on 0.5.31. I'll report back here if we still have any trouble past 2038 after upgrading.

For anyone still on an older version, I ended up using JS's .getDate() and .getMonth() functions to accomplish my goal past the year 2038.

@gilmoreorless
Copy link
Member

I'm going to close this as it looks like the data issue has been resolved.

As a side note, we're looking at a future compromise between data accuracy and file size. At some point we'll likely lock the maximum date range in the data to <year of release> + 100 (e.g. 2123 for any release built this year).
See #1039 for details. Since you've been directly affected by data range issues, let me know if that would cause a problem.

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

No branches or pull requests

5 participants