mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-28 10:37:17 +02:00
LibJS: Use Temporal's ISO8601 parser to parse UTC offset strings
We now have the Temporal facilities to implement the Date AOs which parse UTC offset strings using the ISO8601 parser. This patch updates those AOs and their callers in accordance with the Temporal spec.
This commit is contained in:
Notes:
github-actions[bot]
2024-11-22 00:25:18 +00:00
Author: https://github.com/trflynn89 Commit: https://github.com/LadybirdBrowser/ladybird/commit/c6fccc04e16 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2471
@@ -115,8 +115,7 @@ TimeZone parse_time_zone_identifier(ParseResult const& parse_result)
|
||||
|
||||
// b. Let offsetString be the source text matched by the UTCOffset[~SubMinutePrecision] Parse Node contained within parseResult.
|
||||
// c. Let offsetNanoseconds be ! ParseDateTimeUTCOffset(offsetString).
|
||||
// FIXME: ParseTimeZoneOffsetString should be renamed to ParseDateTimeUTCOffset and updated for Temporal.
|
||||
auto offset_nanoseconds = parse_time_zone_offset_string(parse_result.time_zone_offset->source_text);
|
||||
auto offset_nanoseconds = parse_date_time_utc_offset(parse_result.time_zone_offset->source_text);
|
||||
|
||||
// d. Let offsetMinutes be offsetNanoseconds / (60 × 10**9).
|
||||
auto offset_minutes = offset_nanoseconds / 60'000'000'000;
|
||||
|
||||
Reference in New Issue
Block a user