fix(validations): support raw GMT/UTC offset strings in timezone validation#6119
Closed
MasterJi27 wants to merge 1 commit into
Closed
fix(validations): support raw GMT/UTC offset strings in timezone validation#6119MasterJi27 wants to merge 1 commit into
MasterJi27 wants to merge 1 commit into
Conversation
…dation Closes JhaSourav07#5261 - Add normalizeTimezone() that maps GMT+N/UTC-N to Etc/GMT∓N format - Expand isValidTimeZone() to try normalization when direct lookup fails - Handle sign inversion (Etc/GMT convention is opposite to common usage) - Map GMT+0/UTC+0 to 'UTC' to avoid Etc/GMT ambiguity - Case-insensitive matching for gmt/utc prefixes - 21 tests covering normalization, schema validation, and edge cases
Contributor
|
@MasterJi27 is attempting to deploy a commit to the jhasourav07's projects Team on Vercel. A member of the Team first needs to authorize it. |
Contributor
|
👋 Hey @MasterJi27! Thanks for your contribution! 🎉 Unfortunately, this PR has been automatically closed because it is not linked to any open issue. To resolve this, please do the following:
We look forward to reviewing your PR once an issue is linked! 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description\n\nFixes #5261\n\n## Pillar\n\n- [x] 🕐 Pillar 3 — Timezone Logic Optimization\n\n## Changes\n\n- Added
ormalizeTimezone() function that maps raw GMT+N/UTC-N strings to Etc/GMT∓N format\n- Expanded isValidTimeZone() to try normalization when direct Intl.DateTimeFormat lookup fails\n- Handles Etc/GMT inverted sign convention automatically\n- Maps GMT+0/UTC+0 to 'UTC' to avoid ambiguity\n- Case-insensitive matching for gmt/utc prefixes\n- Rejects fractional offsets like UTC+5:30 (not supported in raw format)\n\n## Verification\n\n- 21 tests all passing:
px vitest run lib/validations.normalizeTimezone.test.ts ✅\n\n## Checklist\n\n- [x] I have read the CONTRIBUTING.md file.\n- [x] I have run
pm run format and
pm run lint locally and resolved all errors.\n- [x] I have run
pm run test and all tests pass locally.\n- [x] My commits follow the Conventional Commits format.\n- [x] I have made sure that I have only one commit to merge in this PR.