1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 10:48:11 +00:00

LibTimeZone: Tweak the enumeration generated for parsed time zones

For example, generate "Etc/GMT+12" as "Etc_GMT_Ahead_12" (instead of as
"Etc_GMT_P12"). A little clearer what the name means without having to
know off-hand what "P" was representing.
This commit is contained in:
Timothy Flynn 2022-01-10 16:41:08 -05:00 committed by Linus Groh
parent d627367489
commit ccce9e5c7f

View file

@ -177,9 +177,9 @@ static String format_identifier(StringView owner, String identifier)
auto offset = identifier.substring_view(gmt_time_zone.length());
if (offset.starts_with('+'))
identifier = String::formatted("{}_P{}", gmt_time_zone, offset.substring_view(1));
identifier = String::formatted("{}_Ahead_{}", gmt_time_zone, offset.substring_view(1));
else if (offset.starts_with('-'))
identifier = String::formatted("{}_M{}", gmt_time_zone, offset.substring_view(1));
identifier = String::formatted("{}_Behind_{}", gmt_time_zone, offset.substring_view(1));
}
}