Skip to content

Fix Moment Timezone error for Manual Offset.#1336

Merged
mauteri merged 2 commits intodevelopfrom
version-0.33.0-rc.1
Jan 10, 2026
Merged

Fix Moment Timezone error for Manual Offset.#1336
mauteri merged 2 commits intodevelopfrom
version-0.33.0-rc.1

Conversation

@mauteri
Copy link
Copy Markdown
Contributor

@mauteri mauteri commented Jan 10, 2026

Description of the Change

Fixes "Moment Timezone has no data for +00:00" error that occurred when WordPress timezone was set to UTC+0 or any manual offset.

Closes #799

How to test the Change

Changelog Entry

Fixed - Bug fix

Credits

Props @patriciabt, @mauteri

Checklist:

  • I agree to follow this project's Code of Conduct.
  • I have updated the documentation accordingly.
  • I have added tests to cover my change.
  • All new and existing tests pass.

@what-the-diff
Copy link
Copy Markdown

what-the-diff bot commented Jan 10, 2026

PR Summary

  • Enhancement in DateTimeRange.js file

    • The file now incorporates a new function normalizeTimezoneForMoment from the datetime helper tool, aimed at adjusting the timezone when operating with date and times, providing enhanced compatibility.
  • Introduction of normalizeTimezoneForMoment function in datetime.js file

    • The function aims at standardizing timezone notations for easy understanding. It simplifies UTC offset strings (example, +00:00, -00:00) to a standard timezone format ('UTC'), which further simplifies working with the Moment Timezone tool.
  • Revision in getTimezone function

    • The function has been enriched with normalizeTimezoneForMoment to ensure standardized timezone notations before any further processing.
  • Improvement in unit tests within datetime.test.js

    • Newly curated tests have been added to determine the effective working of the normalizeTimezoneForMoment function. These tests cover various scenarios to verify the conversion logic for offset strings and ensure that handling of other time zones remains unaffected.

@mauteri mauteri changed the title Fix Moment Timezone error for UTC+0 offset. Fix Moment Timezone error for Manual Offset. Jan 10, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Preview changes with Playground

You can preview the recent changes for PR#1336 with the following PHP versions:

PHP Version 8.4

PHP Version 8.2

PHP Version 7.4

Download .zip with build changes

Made with 💙 from GatherPress & a little bit of WordPress Playground. Changes will not persist between sessions.

@mauteri mauteri marked this pull request as ready for review January 10, 2026 02:58
@mauteri mauteri merged commit 3fe8a04 into develop Jan 10, 2026
11 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.

Moment Timezone has no data for +00:00 (जीएमटी)

1 participant