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

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
parent d129e1ff29
commit 38809f90d9
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.