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

Days difference calculation is wrong if the date format is DD-MMM-YY and year is more than 49(2049) #2855

Open
gmprabu opened this issue Apr 2, 2025 · 0 comments

Comments

@gmprabu
Copy link

gmprabu commented Apr 2, 2025

Describe the bug
const expInDays = dayjs('31-DEC-50').diff(dayjs(), 'day');
Above code considers year as 1950 instead of 2050. same code with 31-DEC-49 considers year as 2049.
DD-MMM-YY format days difference calculation works fine till 2049.

Expected behavior
It should calculate days correctly.

Information

  • Day.js Version 1.11.13
  • OS: Windows
  • Browser Chrome
@gmprabu gmprabu changed the title Days difference calculation is wrong if the year format is more than 2049 Days difference calculation is wrong if the date is format DD-MMM-YY and year more than 49(2049) Apr 2, 2025
@gmprabu gmprabu changed the title Days difference calculation is wrong if the date is format DD-MMM-YY and year more than 49(2049) Days difference calculation is wrong if the date format is DD-MMM-YY and year is more than 49(2049) Apr 2, 2025
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

No branches or pull requests

1 participant