Skip to content

fix: add America/St_Johns handling to tzOffset#7

Merged
kossnocorp merged 2 commits intodate-fns:mainfrom
allohamora:bugfix/wrong-time-offset
Sep 21, 2024
Merged

fix: add America/St_Johns handling to tzOffset#7
kossnocorp merged 2 commits intodate-fns:mainfrom
allohamora:bugfix/wrong-time-offset

Conversation

@allohamora
Copy link
Copy Markdown
Contributor

This PR fixes incorrect America/St_Johns handling in tzOffset and refactors some code.

Before:
image

After:
image

allohamora and others added 2 commits September 19, 2024 19:10
- Made tests less specific
- Added tests for positive fractional time zones
- The trick with assigning NaN cut few bytes from the function 219 B -> 214 B
@kossnocorp
Copy link
Copy Markdown
Member

@allohamora thank you so much for the bugfix. 9 years working on the library, and I never heard that there's a negative fractional time zone 🫠

I added more tests, made them less specific, and cut a few bytes with the default NaN value trick.

I will ship a new release as soon as possible.

Copy link
Copy Markdown
Member

@kossnocorp kossnocorp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🙏 thank you

@kossnocorp kossnocorp merged commit c01f4fd into date-fns:main Sep 21, 2024
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.

2 participants