1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 20:47:45 +00:00

LibJS+LibTimeZone+LibUnicode: Indicate whether a time zone is in DST

Return whether the time zone is in DST during the provided time from
TimeZone::get_time_zone_offset,
This commit is contained in:
Timothy Flynn 2022-01-19 14:18:02 -05:00 committed by Linus Groh
parent 42c9c57141
commit 70f49d0696
7 changed files with 86 additions and 69 deletions

View file

@ -175,10 +175,10 @@ i64 get_iana_time_zone_offset_nanoseconds(BigInt const& epoch_nanoseconds, Strin
else
time = Time::from_seconds(*seconds.to_base(10).to_int<i64>());
auto offset_seconds = ::TimeZone::get_time_zone_offset(*time_zone, time);
VERIFY(offset_seconds.has_value());
auto offset = ::TimeZone::get_time_zone_offset(*time_zone, time);
VERIFY(offset.has_value());
return *offset_seconds * 1'000'000'000;
return offset->seconds * 1'000'000'000;
}
// 11.6.5 GetIANATimeZoneNextTransition ( epochNanoseconds, timeZoneIdentifier ), https://tc39.es/proposal-temporal/#sec-temporal-getianatimezonenexttransition