Skip to content

timezoneOffset ignored in date when preserveTimezones is enabled #605

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

Closed
slavivanov opened this issue Apr 13, 2023 · 1 comment
Closed

Comments

@slavivanov
Copy link
Contributor

In 10.7.0, when passing an explicit timezone to date, with preserveTimezones enabled:

new Liquid({ preserveTimezones: true }).parseAndRender(
  `{{ "1990-12-31T23:00:00Z" | date: "%Y-%m-%dT%H:%M:%S", "Asia/Colombo" }}`
)

the explicit timezone is ignored, and the output is
1990-12-31T23:00:00
instead of the expected
1991-01-01T04:30:00.

It seems to me that this line in TimezoneDate should respect the passed timezoneOffset instead of the init.timezoneOffset but that might break other code relying on this assumption.

Alternatively, in date.ts we could overwrite the date.timezoneOffset with the explicitly provided timezone.

@harttle harttle added the bug label Apr 23, 2023
github-actions bot pushed a commit that referenced this issue Apr 24, 2023
## [10.7.1](v10.7.0...v10.7.1) (2023-04-24)

### Bug Fixes

* incorrect timezone correction for DST dates, fixes [#604](#604) ([33b3c01](33b3c01))
* timezoneOffset ignored in date when preserveTimezones is enabled, fixes [#605](#605) ([21ee27b](21ee27b))
@github-actions
Copy link

🎉 This issue has been resolved in version 10.7.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

2 participants