1 // |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally
2 // Copyright (C) 2024 Igalia, S.L. All rights reserved.
3 // This code is governed by the BSD license found in the LICENSE file.
6 esid: sec-temporal.plainmonthday.prototype.tolocalestring
7 description: Basic tests that dateStyle option affects output
8 locale: [en-u-ca-gregory, en-u-ca-islamic]
9 features: [Temporal, Intl.DateTimeFormat-datetimestyle]
12 const dateGregorian = Temporal.PlainMonthDay.from({ monthCode: "M03", day: 26, calendar: "gregory" });
15 dateGregorian.toLocaleString("en-u-ca-gregory", { dateStyle: "long" }).includes("March"),
16 "dateStyle: long writes month of March out in full"
19 !dateGregorian.toLocaleString("en-u-ca-gregory", { dateStyle: "short" }).includes("March"),
20 "dateStyle: short does not write month of March out in full"
23 const dateIslamic = Temporal.PlainMonthDay.from({ monthCode: "M09", day: 16, calendar: "islamic" });
26 dateIslamic.toLocaleString("en-u-ca-islamic", { dateStyle: "long" }).includes("Ramadan"),
27 "dateStyle: long writes month of Ramadan out in full"
30 !dateIslamic.toLocaleString("en-u-ca-islamic", { dateStyle: "short" }).includes("Ramadan"),
31 "dateStyle: short does not write month of Ramadan out in full"