Skip to content

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

Merged
JhaSourav07 merged 1 commit into
JhaSourav07:mainfrom
MasterJi27:fix/gmt-utc-offset-validation-5261
Jun 21, 2026
Merged

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

Conversation

@MasterJi27

Copy link
Copy Markdown
Contributor

Fixes #5261

…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
@github-actions

github-actions Bot commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

📦 Next.js Bundle Size Report (Gzipped Sizes)

Asset PR Size Base Size Difference Status
static/chunks/9389-[hash].js 5.98 KB 5.86 KB +0.12 KB (+1.98%) 🔴 Regression

📊 Summary of Totals

Category PR Size Base Size Difference
Total JS 3694.60 KB 3694.34 KB +0.26 KB (+0.01%)
Total CSS 296.06 KB 296.06 KB 0 B

@Aamod-Dev Aamod-Dev added GSSoC 2026 mentor:Aamod007 level:advanced Complex contributions involving architecture, optimization, or significant feature work quality:clean PR follows clean coding practices, proper formatting, documentation, and maintainability standards. feature A completely new feature or major addition to the project. bug Something isn't working labels Jun 21, 2026

@Aamod-Dev Aamod-Dev left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Supporting raw GMT/UTC offset strings in timezone validation is a huge quality of life improvement for users not familiar with the tz database format. Handling the inverted sign convention (GMT+N -> Etc/GMT-N) inside normalizeTimezone is handled perfectly. Great test coverage as well. Approved!

@JhaSourav07 JhaSourav07 added the gssoc:approved PR has been reviewed and accepted for valid contribution points label Jun 21, 2026
@JhaSourav07 JhaSourav07 merged commit 306e441 into JhaSourav07:main Jun 21, 2026
15 of 16 checks passed
@github-actions github-actions Bot added this to the GSSoC 2026 milestone Jun 21, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🎉 Congratulations @MasterJi27! Your PR has been successfully merged. 🚀

Thank you for contributing to CommitPulse. Your work helps us build a better tool for the community.

⚠️ Important for GSSoC Contributors:
You are strictly advised to join our Discord Server as it is mandatory for all GSSoC participants. All important announcements, point claims, and community discussions happen there.

Keep building! 💻✨

@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

bug Something isn't working feature A completely new feature or major addition to the project. gssoc:approved PR has been reviewed and accepted for valid contribution points GSSoC 2026 level:advanced Complex contributions involving architecture, optimization, or significant feature work mentor:Aamod007 quality:clean PR follows clean coding practices, proper formatting, documentation, and maintainability standards. type:bug Something isn't working as expected

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: Support raw GMT/UTC offsets in validation schema

3 participants