Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// Copyright (C) 2025 Igalia, S.L. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.

/*---
esid: sec-temporal-calendarsupportsera
description: Calendar era code is canonicalized (non-Gregorian calendars)
features: [Temporal, Intl.Era-monthcode]
---*/


const calendarEraAliases = [
{ calendar: "japanese", canonicalizedEra: "ce", alias: "ad" },
{ calendar: "japanese", canonicalizedEra: "bce", alias: "bc" }
];


for (const calendarEraAlias of calendarEraAliases) {
const calendar = Temporal.PlainDate.from({
calendar: calendarEraAlias.calendar,
era: calendarEraAlias.alias,
eraYear: 1,
month: 1,
day: 1
});
assert.sameValue(calendar.era, calendarEraAlias.canonicalizedEra, calendar.era + " should canonicalize to " + calendarEraAlias.canonicalizedEra)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// Copyright (C) 2025 Igalia, S.L. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.

/*---
esid: sec-temporal.plaindatetime.from
description: Calendar era code is canonicalized (non-Gregorian calendars)
features: [Temporal, Intl.Era-monthcode]
---*/


const calendarEraAliases = [
{ calendar: "japanese", canonicalizedEra: "ce", alias: "ad" },
{ calendar: "japanese", canonicalizedEra: "bce", alias: "bc" }
];


for (const calendarEraAlias of calendarEraAliases) {
const calendar = Temporal.PlainDateTime.from({
calendar: calendarEraAlias.calendar,
era: calendarEraAlias.alias,
eraYear: 1,
month: 1,
day: 1
});
assert.sameValue(calendar.era, calendarEraAlias.canonicalizedEra, calendar.era + " should canonicalize to " + calendarEraAlias.canonicalizedEra)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// Copyright (C) 2025 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: Calendar era code is canonicalized (non-Gregorian calendars)
features: [Temporal, Intl.Era-monthcode]
---*/


const calendarEraAliases = [
{ calendar: "japanese", canonicalizedEra: "ce", alias: "ad" },
{ calendar: "japanese", canonicalizedEra: "bce", alias: "bc" }
];


for (const calendarEraAlias of calendarEraAliases) {
const calendar = Temporal.PlainYearMonth.from({
calendar: calendarEraAlias.calendar,
era: calendarEraAlias.alias,
eraYear: 1,
month: 1,
day: 1
});
assert.sameValue(calendar.era, calendarEraAlias.canonicalizedEra, calendar.era + " should canonicalize to " + calendarEraAlias.canonicalizedEra)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// Copyright (C) 2025 Igalia, S.L. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.

/*---
esid: sec-temporal.zonedatetime.from
description: Calendar era code is canonicalized (non-Gregorian calendars)
features: [Temporal, Intl.Era-monthcode]
---*/


const calendarEraAliases = [
{ calendar: "japanese", canonicalizedEra: "ce", alias: "ad" },
{ calendar: "japanese", canonicalizedEra: "bce", alias: "bc" }
];


for (const calendarEraAlias of calendarEraAliases) {
const calendar = Temporal.ZonedDateTime.from({
calendar: calendarEraAlias.calendar,
era: calendarEraAlias.alias,
eraYear: 1,
month: 1,
day: 1,
timeZone: "UTC"
});
assert.sameValue(calendar.era, calendarEraAlias.canonicalizedEra, calendar.era + " should canonicalize to " + calendarEraAlias.canonicalizedEra)
}