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

fix!: work with timezones #41

Merged
merged 3 commits into from
Dec 28, 2023
Merged

fix!: work with timezones #41

merged 3 commits into from
Dec 28, 2023

Conversation

ValeraS
Copy link
Collaborator

@ValeraS ValeraS commented Dec 28, 2023

  • rewritten internal date-maths
  • corrected DateTime's public API types

Breaking changes:

  • work with UTC the same as with other timezones, in case if input date does not contain timezone information
guessUserTimeZone() == 'Europe/Moscow';
 // Before
dateTime({input: '2023-12-31', timeZone: 'UTC') == '2023-12-31T00:00Z'
// After
dateTime({input: '2023-12-31', timeZone: 'UTC') == '2023-12-30T21:00Z'

* fix: performance

* fix: work with years from 0 to 100

* fix: do not patch dayjs object

* test: add more tests

* fix: rollback types changes
@ValeraS ValeraS requested a review from korvin89 December 28, 2023 16:12
@ValeraS ValeraS merged commit 23488cc into main Dec 28, 2023
5 checks passed
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