Skip to content

fix: Update deprecated timezone names - #756

Merged
phil-davis merged 2 commits into
sabre-io:masterfrom
ralflang:fix/deprecated-timezone-names
May 31, 2026
Merged

phil-davis merged 2 commits into
sabre-io:masterfrom
ralflang:fix/deprecated-timezone-names

Conversation

@ralflang

Copy link
Copy Markdown
Contributor

Supersedes #755 which was based against the current maintenance branch and thus had a huge, misleading diff.

fix(timezonedata): Replace deprecated IANA timezone names

Systems without the tzdata-legacy package, i.e. (Ubuntu 24.04+) reject deprecated names.

Examples: Europe/Kiev, Asia/Calcutta, America/Godthab
This causes FindFromTimezoneMap::find() to throw.
Update all 13 occurrences across windowszones, lotuszones and exchangezones maps to their canonical replacements and wrap DateTimeZone instantiation in try/catch for resilience against future renames.

Comes with unit test

@phil-davis
phil-davis force-pushed the fix/deprecated-timezone-names branch from ef1d848 to 675c657 Compare May 31, 2026 11:07
@codecov

codecov Bot commented May 31, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 78.94737% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 98.69%. Comparing base (fdf34ea) to head (091d6d8).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
lib/TimezoneGuesser/FindFromTimezoneMap.php 33.33% 4 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master     #756      +/-   ##
============================================
- Coverage     98.77%   98.69%   -0.08%     
- Complexity     1889     1891       +2     
============================================
  Files            71       71              
  Lines          5296     5300       +4     
============================================
  Hits           5231     5231              
- Misses           65       69       +4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

'N. Central Asia Standard Time' => 'Asia/Novosibirsk',
'Namibia Standard Time' => 'Africa/Windhoek',
'Nepal Standard Time' => 'Asia/Katmandu',
'Nepal Standard Time' => 'Asia/Kathmandu',

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Yes! This has been annoying having Kathmandu spelled wrong.

@phil-davis
phil-davis requested review from phil-davis and staabm May 31, 2026 11:14

@phil-davis phil-davis left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This LGTM.
@staabm what do you think?
Can you see any issue about the old names etc?

{
// Next, we check if the tzid is somewhere in our tzid map.
if ($this->hasTzInMap($tzid)) {
return new \DateTimeZone($this->getTzFromMap($tzid));

@staabm staabm May 31, 2026 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

before this PR the observed behaviour of find was that it would throw (even if it was not a documented behaviour).

I find the new behaviour more useful, but I think we need to at least document this "breaking change" - we can use a @throws void phpdoc (for static analysis support), but can also document it in the changelog

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

done, and will mention this in the changelog/release notes. This can be part of a minor version bump.

ralflang and others added 2 commits May 31, 2026 21:36
Systems without the tzdata-legacy package, i.e. (Ubuntu 24.04+) reject deprecated names.

Examples: Europe/Kiev, Asia/Calcutta, America/Godthab
This causes FindFromTimezoneMap::find() to throw.
Update all 13 occurrences across windowszones, lotuszones and exchangezones maps to their canonical replacements and wrap DateTimeZone instantiation in try/catch for resilience against future renames.

Comes with unit test
@phil-davis
phil-davis force-pushed the fix/deprecated-timezone-names branch from 3d5f750 to 091d6d8 Compare May 31, 2026 12:06
@phil-davis
phil-davis requested a review from staabm May 31, 2026 12:09
@phil-davis
phil-davis merged commit 2a799e6 into sabre-io:master May 31, 2026
7 of 9 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.

3 participants