blob: be8cc7e93f8812e663bf71e2ee1b509540c45d31 [file] [log] [blame]
// 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.protoype.tostring
description: always value for calendarName option
features: [Temporal]
---*/
const calendar = {
toString() { return "custom"; }
};
const yearmonth1 = new Temporal.PlainYearMonth(2000, 5);
const yearmonth2 = new Temporal.PlainYearMonth(2000, 5, calendar);
[
[yearmonth1, "2000-05-01[u-ca=iso8601]"], // fallback day 1 used
[yearmonth2, "2000-05-01[u-ca=custom]"],
].forEach(([yearmonth, expected]) => {
const result = yearmonth.toString({ calendarName: "always" });
assert.sameValue(result, expected, "calendarName is always");
});