1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-06-01 02:18:12 +00:00

LibJS: Implement Temporal.TimeZone.prototype.getNextTransition()

This commit is contained in:
Linus Groh 2021-10-30 10:26:42 +02:00
parent 5fde02184d
commit e9cbeeac45
6 changed files with 63 additions and 0 deletions

View file

@ -177,6 +177,15 @@ i64 get_iana_time_zone_offset_nanoseconds([[maybe_unused]] BigInt const& epoch_n
return 0;
}
// 11.6.6 GetIANATimeZoneNextTransition ( epochNanoseconds, timeZoneIdentifier ), https://tc39.es/proposal-temporal/#sec-temporal-getianatimezonenexttransition
BigInt* get_iana_time_zone_next_transition(GlobalObject&, [[maybe_unused]] BigInt const& epoch_nanoseconds, [[maybe_unused]] StringView time_zone_identifier)
{
// The abstract operation GetIANATimeZoneNextTransition is an implementation-defined algorithm that returns an integer representing the number of nanoseconds since the Unix epoch in UTC that corresponds to the first time zone transition after epochNanoseconds in the IANA time zone identified by timeZoneIdentifier or null if no such transition exists.
// TODO: Implement this
return nullptr;
}
// https://tc39.es/proposal-temporal/#prod-TimeZoneNumericUTCOffset
static bool parse_time_zone_numeric_utc_offset_syntax(String const& offset_string, StringView& sign, StringView& hours, Optional<StringView>& minutes, Optional<StringView>& seconds, Optional<StringView>& fraction)
{