test262/test/intl402/Temporal/Now/zonedDateTime/calendar-string.js

17 lines
663 B
JavaScript
Raw Normal View History

2022-01-24 12:15:04 +01:00
// Copyright (C) 2022 Igalia, S.L. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-temporal.now.zoneddatetime
description: String calendar argument
features: [Temporal]
---*/
const zdt = Temporal.Now.zonedDateTime("gregory");
const tz = Temporal.Now.timeZoneId();
2022-01-24 12:15:04 +01:00
assert(zdt instanceof Temporal.ZonedDateTime);
assert.sameValue(typeof zdt.getISOFields().calendar, "string", "calendar slot should store a string");
assert.sameValue(zdt.calendarId, "gregory");
assert.sameValue(typeof zdt.getISOFields().timeZone, "string", "time zone slot should store a string");
assert.sameValue(zdt.timeZoneId, tz);