mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-01 13:49:16 +00:00
LibJS+LibTimeZone: Explicitly canonicalize "GMT" to "UTC"
This is a normative change in the ECMA-402 spec. See:
50eb413
Note that this canonicalization already occurred. As the above commit
alludes to, we parse the rearguard format of the TZDB, so GMT is already
an alias to Etc/GMT. But it doesn't hurt to be explicit here.
This commit is contained in:
parent
c5c6065611
commit
6d49eab8a6
Notes:
sideshowbarker
2024-07-17 02:57:43 +09:00
Author: https://github.com/trflynn89
Commit: 6d49eab8a6
Pull-request: https://github.com/SerenityOS/serenity/pull/18007
Reviewed-by: https://github.com/linusg ✅
2 changed files with 3 additions and 2 deletions
|
@ -177,7 +177,7 @@ Optional<StringView> canonicalize_time_zone(StringView time_zone)
|
|||
return {};
|
||||
|
||||
auto canonical_time_zone = time_zone_to_string(*maybe_time_zone);
|
||||
if (canonical_time_zone.is_one_of("Etc/UTC"sv, "Etc/GMT"sv))
|
||||
if (canonical_time_zone.is_one_of("Etc/UTC"sv, "Etc/GMT"sv, "GMT"sv))
|
||||
return "UTC"sv;
|
||||
|
||||
return canonical_time_zone;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue