summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibJS/Runtime/Temporal/Instant.cpp
diff options
context:
space:
mode:
authorLinus Groh <mail@linusgroh.de>2021-11-04 16:45:54 +0100
committerLinus Groh <mail@linusgroh.de>2021-11-04 16:45:54 +0100
commit38809f90d9bd3c7f0deaa7122dc4a543c64625ba (patch)
tree98568f48592f97a6b8aac73ecc6d9795369a9274 /Userland/Libraries/LibJS/Runtime/Temporal/Instant.cpp
parentd129e1ff29608e178d72e94a486e0510502feb2f (diff)
downloadserenity-38809f90d9bd3c7f0deaa7122dc4a543c64625ba.zip
LibJS: Introduce & use FormatISOTimeZoneOffsetString
This is a normative change in the Temporal spec. See: https://github.com/tc39/proposal-temporal/commit/6b7a993
Diffstat (limited to 'Userland/Libraries/LibJS/Runtime/Temporal/Instant.cpp')
-rw-r--r--Userland/Libraries/LibJS/Runtime/Temporal/Instant.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/Instant.cpp b/Userland/Libraries/LibJS/Runtime/Temporal/Instant.cpp
index 2484feac11..e8595d553a 100644
--- a/Userland/Libraries/LibJS/Runtime/Temporal/Instant.cpp
+++ b/Userland/Libraries/LibJS/Runtime/Temporal/Instant.cpp
@@ -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.