Skip to content

fix(validations): support raw GMT/UTC offset strings in timezone validation#6119

Closed
MasterJi27 wants to merge 1 commit into
JhaSourav07:mainfrom
MasterJi27:fix/gmt-utc-offset-validation-5261
Closed

fix(validations): support raw GMT/UTC offset strings in timezone validation#6119
MasterJi27 wants to merge 1 commit into
JhaSourav07:mainfrom
MasterJi27:fix/gmt-utc-offset-validation-5261

Conversation

@MasterJi27

Copy link
Copy Markdown
Contributor

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.

…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
@vercel

vercel Bot commented Jun 20, 2026

Copy link
Copy Markdown
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.

@github-actions

Copy link
Copy Markdown
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:

  1. Link a valid open issue by editing your PR description to include a closing keyword (e.g., Fixes #<issue-number>).
  2. Reopen this PR once the link is added.

💡 You can link multiple issues if needed (e.g. Fixes #12, Closes #34).
If you're working on something that doesn't have an issue yet, please open one first and then link it here.

We look forward to reviewing your PR once an issue is linked! 🚀

@github-actions github-actions Bot closed this Jun 20, 2026
@github-actions github-actions Bot added the type:bug Something isn't working as expected label Jun 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type:bug Something isn't working as expected

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant