1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 19:17:44 +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:
Timothy Flynn 2023-03-23 08:00:16 -04:00 committed by Linus Groh
parent c5c6065611
commit 6d49eab8a6
2 changed files with 3 additions and 2 deletions

View file

@ -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;