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

πŸ›‘ Wrong dateUntil when start_date.day == 29 || 30 || 31 & end_date.day == 28 || 29 || 30 || 31 #13

Closed
nitin2953 opened this issue May 22, 2022 · 6 comments

Comments

@nitin2953
Copy link

Interactive test https://datediff.netlify.app/
Repo https://github.com/nitin2953/date-diff-test


STARTING WITH 29

Wrong Diff if end_date is 28 Feb (not 29) (Future Only)
DD MMM YYYY DD MMM YYYY Temporal fcTemporal β­•
Past
29 Jan 2022 28 Feb 2020 -1Y -11M -01D -1Y -11M -01D βœ…
29 Jan 2022 29 Feb 2020 -1Y -11M 00D -1Y -11M 00D βœ…
29 Jan 2022 01 Mar 2020 -1Y -10M -28D -1Y -10M -28D βœ…
29 Jan 2022 27 Feb 2021 0Y -11M -01D 0Y -11M -01D βœ…
29 Jan 2022 28 Feb 2021 0Y -11M 00D 0Y -11M 00D βœ…
29 Jan 2022 01 Mar 2021 0Y -10M -28D 0Y -10M -28D βœ…
Future
29 Jan 2022 27 Feb 2022 0Y 00M 29D 0Y 00M 29D βœ…
29 Jan 2022 28 Feb 2022 0Y 01M 00D 0Y 00M 30D ❌
29 Jan 2022 01 Mar 2022 0Y 01M 01D 0Y 01M 01D βœ…
29 Jan 2022 27 Feb 2023 1Y 00M 29D 1Y 00M 29D βœ…
29 Jan 2022 28 Feb 2023 1Y 01M 00D 1Y 00M 30D ❌
29 Jan 2022 01 Mar 2023 1Y 01M 01D 1Y 01M 01D βœ…
29 Jan 2022 28 Feb 2024 2Y 00M 30D 2Y 00M 30D βœ…
29 Jan 2022 29 Feb 2024 2Y 01M 00D 2Y 01M 00D βœ…
29 Jan 2022 01 Mar 2024 2Y 01M 01D 2Y 01M 01D βœ…
29 Jan 2022 27 Feb 2025 3Y 00M 29D 3Y 00M 29D βœ…
29 Jan 2022 28 Feb 2025 3Y 01M 00D 3Y 00M 30D ❌
29 Jan 2022 01 Mar 2025 3Y 01M 01D 3Y 01M 01D βœ…

STARTING WITH 30

Wrong Diff if end_date is 28/29 Feb (Future Only)
DD MMM YYYY DD MMM YYYY Temporal fcTemporal β­•
Past
30 Jan 2022 28 Feb 2020 -1Y -11M -01D -1Y -11M -01D βœ…
30 Jan 2022 29 Feb 2020 -1Y -11M 00D -1Y -11M 00D βœ…
30 Jan 2022 01 Mar 2020 -1Y -10M -29D -1Y -10M -29D βœ…
30 Jan 2022 27 Feb 2021 0Y -11M -01D 0Y -11M -01D βœ…
30 Jan 2022 28 Feb 2021 0Y -11M 00D 0Y -11M 00D βœ…
30 Jan 2022 01 Mar 2021 0Y -10M -29D 0Y -10M -29D βœ…
Future
30 Jan 2022 27 Feb 2022 0Y 0M 28D 0Y 0M 28D βœ…
30 Jan 2022 28 Feb 2022 0Y 1M 00D 0Y 0M 29D ❌
30 Jan 2022 01 Mar 2022 0Y 1M 01D 0Y 1M 01D βœ…
30 Jan 2022 27 Feb 2023 1Y 0M 28D 1Y 0M 28D βœ…
30 Jan 2022 28 Feb 2023 1Y 1M 00D 1Y 0M 29D ❌
30 Jan 2022 01 Mar 2023 1Y 1M 01D 1Y 1M 01D βœ…
30 Jan 2022 28 Feb 2024 2Y 0M 29D 2Y 0M 29D βœ…
30 Jan 2022 29 Feb 2024 2Y 1M 00D 2Y 0M 30D ❌
30 Jan 2022 01 Mar 2024 2Y 1M 01D 2Y 1M 01D βœ…
30 Jan 2022 27 Feb 2025 3Y 0M 28D 3Y 0M 28D βœ…
30 Jan 2022 28 Feb 2025 3Y 1M 00D 3Y 0M 29D ❌
30 Jan 2022 01 Mar 2025 3Y 1M 01D 3Y 1M 01D βœ…

STARTING WITH 31

Wrong Diff if total_days & end_date.day is 30 AND at 28/29 Feb (Future Only)
β„Ή TD = total_days in end_date.month
DD MMM YYYY DD MMM YYYY Temporal fcTemporal β­• TD
Past, All βœ…
Future
31 Jan 2022 28 Feb 2022 0Y 01M 0D 0Y 0M 28D ❌ 28
31 Jan 2022 31 Mar 2022 0Y 02M 0D 0Y 2M 00D βœ… 31
31 Jan 2022 30 Apr 2022 0Y 03M 0D 0Y 2M 30D ❌ 30
31 Jan 2022 31 May 2022 0Y 04M 0D 0Y 4M 00D βœ… 31
31 Jan 2022 30 Jun 2022 0Y 05M 0D 0Y 4M 30D ❌ 30
31 Jan 2022 31 Jul 2022 0Y 06M 0D 0Y 6M 00D βœ… 31
31 Jan 2022 31 Aug 2022 0Y 07M 0D 0Y 7M 00D βœ… 31
31 Jan 2022 30 Sep 2022 0Y 08M 0D 0Y 7M 30D ❌ 30
31 Jan 2022 31 Oct 2022 0Y 09M 0D 0Y 9M 00D βœ… 31
31 Jan 2022 30 Nov 2022 0Y 10M 0D 0Y 9M 30D ❌ 30
31 Jan 2022 31 Dec 2022 0Y 11M 0D 0Y 11M 0D βœ… 31
31 Jan 2022 31 Jan 2023 1Y 00M 0D 1Y 0M 00D βœ… 31
31 Jan 2022 28 Feb 2023 1Y 01M 0D 1Y 0M 28D ❌ 28
…
31 Jan 2022 29 Feb 2024 2Y 01M 0D 2Y 0M 29D ❌ 29
@arshaw
Copy link
Member

arshaw commented Apr 22, 2023

@nitin2953 , thank you for this incredibly comprehensive bug reports. One of the best bug reports I've seen. I can confirm, this is a bug. I'll fix while I'm refactoring for the next release (more info: https://github.com/fullcalendar/temporal#project-update-2023-04-22)

@digaus
Copy link

digaus commented Aug 9, 2023

Any ETA on next release? :)

@arshaw
Copy link
Member

arshaw commented Sep 12, 2023

Hi @digaus, please see my update here: #3 (comment) (I'm essentially using that thread as a tracking issue for the next release).

@arshaw
Copy link
Member

arshaw commented Jan 7, 2024

This is fixed in v0.2.0. Please confirm when you have a chance. Thanks!

@arshaw arshaw closed this as completed Jan 23, 2024
@nitin2953
Copy link
Author

Hi @arshaw,
Thanks for the great work on the refactoring!
The v0.2.0 has fixed all issues but Unfortunately, all those issues have reappeared in v0.2.4
I haven't had the chance to test any versions prior to v0.2.4 and unfortunately, I also don't have the time to update my testing website.

@arshaw
Copy link
Member

arshaw commented May 29, 2024

Hi @nitin2953, I've updated your repro repo here:
https://github.com/fullcalendar/date-diff-test

It's been updated to use the latest "playground" from tc39's reference implementation as well as fullcalendar's temporal-polyfill latest version 0.2.4

I've tried a number of the error cases you originally posted and don't see any difference in behavior between the reference implementation and fullcalendar's polyfill.

The diffing algorithm changed in the tc39 spec a few months ago, and fullcalendar's polyfill adapted to those changes, so maybe you're comparing the new version of one implementation to the old version of the other

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

3 participants