mirror of
https://github.com/tc39/test262.git
synced 2025-08-19 00:48:29 +02:00
Previously getISOFields() was used to get the exact value of the [[Calendar]] and [[TimeZone]] internal slots, as well as to get the reference ISO year for PlainMonthDay and reference ISO day for PlainYearMonth. Use calendarId and timeZoneId for the former and toString() for the latter.
16 lines
687 B
JavaScript
16 lines
687 B
JavaScript
// 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.plainyearmonth.from
|
|
description: A PlainYearMonth argument is cloned
|
|
includes: [temporalHelpers.js]
|
|
features: [Temporal]
|
|
---*/
|
|
|
|
const plainDate = Temporal.PlainDate.from("1976-11-18");
|
|
const plainYearMonth = Temporal.PlainYearMonth.from(plainDate);
|
|
TemporalHelpers.assertPlainYearMonth(plainYearMonth, 1976, 11, "M11");
|
|
assert.sameValue(plainYearMonth.calendarId, "iso8601", "calendar string should be iso8601");
|
|
assert.sameValue(plainYearMonth.toString({ calendarName: "always" }), "1976-11-01[u-ca=iso8601]", "iso reference date");
|