LibJS: Introduce & use FormatISOTimeZoneOffsetString

This is a normative change in the Temporal spec.

See: 6b7a993
This commit is contained in:
Linus Groh 2021-11-04 16:45:54 +01:00
commit 38809f90d9
Notes: sideshowbarker 2024-07-18 01:30:16 +09:00
3 changed files with 40 additions and 9 deletions

View file

@ -263,8 +263,11 @@ ThrowCompletionOr<String> temporal_instant_to_string(GlobalObject& global_object
}
// 9. Else,
else {
// a. Let timeZoneString be ? BuiltinTimeZoneGetOffsetStringFor(timeZone, instant).
time_zone_string = TRY(builtin_time_zone_get_offset_string_for(global_object, time_zone, instant));
// a. Let offsetNs be ? GetOffsetNanosecondsFor(timeZone, instant).
auto offset_ns = TRY(get_offset_nanoseconds_for(global_object, time_zone, instant));
// b. Let timeZoneString be ! FormatISOTimeZoneOffsetString(offsetNs).
time_zone_string = format_iso_time_zone_offset_string(offset_ns);
}
// 10. Return the string-concatenation of dateTimeString and timeZoneString.