summaryrefslogtreecommitdiff
path: root/Userland/Libraries
diff options
context:
space:
mode:
authorLinus Groh <mail@linusgroh.de>2021-08-01 17:54:28 +0100
committerLinus Groh <mail@linusgroh.de>2021-08-01 20:31:31 +0100
commit14e7eff43f671f4a899c922f73adaa665b2eb559 (patch)
treeb034487323dea400431c1f1b9045cc1af7eeb683 /Userland/Libraries
parentcfb77b66e51a04892b791e88eae92a9c02d76bdc (diff)
downloadserenity-14e7eff43f671f4a899c922f73adaa665b2eb559.zip
LibJS: Handle ZonedDateTime in ToTemporalCalendar
Diffstat (limited to 'Userland/Libraries')
-rw-r--r--Userland/Libraries/LibJS/Runtime/Temporal/Calendar.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/Calendar.cpp b/Userland/Libraries/LibJS/Runtime/Temporal/Calendar.cpp
index 1f1f6a6fc9..b35e69c3ca 100644
--- a/Userland/Libraries/LibJS/Runtime/Temporal/Calendar.cpp
+++ b/Userland/Libraries/LibJS/Runtime/Temporal/Calendar.cpp
@@ -13,6 +13,7 @@
#include <LibJS/Runtime/Temporal/PlainDate.h>
#include <LibJS/Runtime/Temporal/PlainDateTime.h>
#include <LibJS/Runtime/Temporal/PlainTime.h>
+#include <LibJS/Runtime/Temporal/ZonedDateTime.h>
#include <LibJS/Runtime/Value.h>
namespace JS::Temporal {
@@ -300,7 +301,9 @@ Object* to_temporal_calendar(GlobalObject& global_object, Value temporal_calenda
return &static_cast<PlainDateTime&>(temporal_calendar_like_object).calendar();
if (is<PlainTime>(temporal_calendar_like_object))
return &static_cast<PlainTime&>(temporal_calendar_like_object).calendar();
- // TODO: The rest of the Temporal built-ins (PlainMonthDay, PlainYearMonth, ZonedDateTime)
+ if (is<ZonedDateTime>(temporal_calendar_like_object))
+ return &static_cast<ZonedDateTime&>(temporal_calendar_like_object).calendar();
+ // TODO: The rest of the Temporal built-ins (PlainMonthDay, PlainYearMonth)
// b. If ? HasProperty(temporalCalendarLike, "calendar") is false, return temporalCalendarLike.
auto has_property = temporal_calendar_like_object.has_property(vm.names.calendar);