Skip to content

Commit 7d21b4a

Browse files
ptomatoMs2ger
authored andcommitted
Intl Era Monthcode: Move tests for extreme dates out of staging
These tests cover creating dates at the edges of the range, and at the edges of the non-approximated range for calendars where that applies.
1 parent 334bb5d commit 7d21b4a

File tree

9 files changed

+695
-85
lines changed

9 files changed

+695
-85
lines changed
Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
// Copyright (C) 2025 Igalia, S.L. All rights reserved.
2+
// This code is governed by the BSD license found in the LICENSE file.
3+
4+
/*---
5+
esid: sec-temporal.plaindate.from
6+
description: from() gives sensible output at extremes of supported range
7+
features: [Temporal, Intl.Era-monthcode]
8+
includes: [temporalHelpers.js]
9+
---*/
10+
11+
// Lunisolar/lunar calendars can't accurately predict celestial orbits for dates
12+
// far into the past/future. Skip `chinese` and `dangi`. `islamic-umalqura` is
13+
// okay because it is specified to fall back to `islamic-civil` outside the
14+
// range of accuracy.
15+
16+
const testData = [
17+
["buddhist", -271278, 4, "M04", 19, "be", -271278, 276303, 9, "M09", 13, "be", 276303],
18+
["coptic", -272099, 3, "M03", 23, "am", -272099, 275471, 5, "M05", 22, "am", 275471],
19+
["ethioaa", -266323, 3, "M03", 23, "aa", -266323, 281247, 5, "M05", 22, "aa", 281247],
20+
["ethiopic", -271823/*14*/, 3, "M03", 23, "aa", -266323, 275747/*67*/, 5, "M05", 22, "am", 275747/*67*/],
21+
["gregory", -271821, 4, "M04", 19, "bce", 271822, 275760, 9, "M09", 13, "ce", 275760],
22+
["hebrew", -268058, 11, "M11", 4, "am", -268058, 279517, 10, "M09", 11, "am", 279517],
23+
["indian", -271899, 1, "M01", 29, "shaka", -271899, 275682, 6, "M06", 22, "shaka", 275682],
24+
["islamic-civil", -280804, 3, "M03", 21, "bh", 280805, 283583, 5, "M05", 23, "ah", 283583],
25+
["islamic-tbla", -280804, 3, "M03", 22, "bh", 280805, 283583, 5, "M05", 24, "ah", 283583],
26+
["islamic-umalqura", -280804, 3, "M03", 21, "bh", 280805, 283583, 5, "M05", 23, "ah", 283583],
27+
["japanese", -271821, 4, "M04", 19, "bce", 271822, 275760, 9, "M09", 13, "reiwa", 273742],
28+
["persian", -272442, 1, "M01", 9, "ap", -272442, 275139, 7, "M07", 12, "ap", 275139],
29+
["roc", -273732, 4, "M04", 19, "broc", 273733, 273849, 9, "M09", 13, "roc", 273849],
30+
];
31+
32+
for (const [calendar, minYear, minMonth, minMonthCode, minDay, minEra, minEraYear, maxYear, maxMonth, maxMonthCode, maxDay, maxEra, maxEraYear] of testData) {
33+
const min = Temporal.PlainDate.from({
34+
calendar,
35+
year: minYear,
36+
era: minEra,
37+
eraYear: minEraYear,
38+
month: minMonth,
39+
monthCode: minMonthCode,
40+
day: minDay,
41+
});
42+
TemporalHelpers.assertPlainDate(min,
43+
minYear, minMonth, minMonthCode, minDay,
44+
`${calendar} minimum supported date`,
45+
minEra, minEraYear);
46+
47+
const max = Temporal.PlainDate.from({
48+
calendar,
49+
year: maxYear,
50+
era: maxEra,
51+
eraYear: maxEraYear,
52+
month: maxMonth,
53+
monthCode: maxMonthCode,
54+
day: maxDay,
55+
});
56+
TemporalHelpers.assertPlainDate(max,
57+
maxYear, maxMonth, maxMonthCode, maxDay,
58+
`${calendar} maximum supported date`,
59+
maxEra, maxEraYear);
60+
}
61+
62+
{
63+
const calendar = "chinese";
64+
const minNonApproximated = Temporal.PlainDate.from({ calendar, year: 1900, month: 1, day: 1 });
65+
const maxNonApproximated = Temporal.PlainDate.from({ calendar, year: 2100, month: 12, day: 29 });
66+
TemporalHelpers.assertPlainDate(minNonApproximated,
67+
1900, 1, "M01", 1, `${calendar} minimum non-approximated date`);
68+
TemporalHelpers.assertPlainDate(maxNonApproximated,
69+
2100, 12, "M12", 29, `${calendar} maximum non-approximated date`);
70+
71+
// Create dates far in the past and future but don't care about the conversion
72+
Temporal.PlainDate.from({ calendar, year: -250000, month: 1, day: 1 });
73+
Temporal.PlainDate.from({ calendar, year: 250000, month: 1, day: 1 });
74+
}
75+
76+
{
77+
const calendar = "dangi";
78+
const minNonApproximated = Temporal.PlainDate.from({ calendar, year: 1900, month: 1, day: 1 });
79+
const maxNonApproximated = Temporal.PlainDate.from({ calendar, year: 2050, month: 13, day: 29 });
80+
TemporalHelpers.assertPlainDate(minNonApproximated,
81+
1900, 1, "M01", 1, `${calendar} minimum non-approximated date`);
82+
TemporalHelpers.assertPlainDate(maxNonApproximated,
83+
2050, 13, "M12", 29, `${calendar} maximum non-approximated date`);
84+
85+
// Create dates far in the past and future but don't care about the conversion
86+
Temporal.PlainDate.from({ calendar, year: -250000, month: 1, day: 1 });
87+
Temporal.PlainDate.from({ calendar, year: 250000, month: 1, day: 1 });
88+
}
89+
90+
// Additionally test the range of islamic-umalqura in which it does not fall
91+
// back to islamic-civil
92+
{
93+
const calendar = "islamic-umalqura";
94+
const minNonApproximated = Temporal.PlainDate.from({ calendar, year: 1300, month: 1, day: 1 });
95+
const maxNonApproximated = Temporal.PlainDate.from({ calendar, year: 1500, month: 12, day: 30 });
96+
TemporalHelpers.assertPlainDate(minNonApproximated,
97+
1300, 1, "M01", 1, `${calendar} minimum non-approximated date`,
98+
"ah", 1300);
99+
TemporalHelpers.assertPlainDate(maxNonApproximated,
100+
1500, 12, "M12", 30, `${calendar} maximum non-approximated date`,
101+
"ah", 1500);
102+
}
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
// Copyright (C) 2025 Igalia, S.L. All rights reserved.
2+
// This code is governed by the BSD license found in the LICENSE file.
3+
4+
/*---
5+
esid: sec-temporal.plaindate.prototype.withcalendar
6+
description: withCalendar gives sensible output at extremes of supported range
7+
features: [Temporal, Intl.Era-monthcode]
8+
includes: [temporalHelpers.js]
9+
---*/
10+
11+
const min = new Temporal.PlainDate(-271821, 4, 19);
12+
const max = new Temporal.PlainDate(275760, 9, 13);
13+
14+
// Lunisolar/lunar calendars can't accurately predict celestial orbits for dates
15+
// far into the past/future. Skip `chinese` and `dangi`. `islamic-umalqura` is
16+
// okay because it is specified to fall back to `islamic-civil` outside the
17+
// range of accuracy.
18+
19+
const testData = [
20+
["buddhist", -271278, 4, "M04", 19, "be", -271278, 276303, 9, "M09", 13, "be", 276303],
21+
["coptic", -272099, 3, "M03", 23, "am", -272099, 275471, 5, "M05", 22, "am", 275471],
22+
["ethioaa", -266323, 3, "M03", 23, "aa", -266323, 281247, 5, "M05", 22, "aa", 281247],
23+
["ethiopic", -271814, 3, "M03", 23, "aa", -266323, 275767, 5, "M05", 22, "am", 275767],
24+
["gregory", -271821, 4, "M04", 19, "bce", 271822, 275760, 9, "M09", 13, "ce", 275760],
25+
["hebrew", -268058, 11, "M11", 4, "am", -268058, 279517, 10, "M09", 11, "am", 279517],
26+
["indian", -271899, 1, "M01", 29, "shaka", -271899, 275682, 6, "M06", 22, "shaka", 275682],
27+
["islamic-civil", -280804, 3, "M03", 21, "bh", 280805, 283583, 5, "M05", 23, "ah", 283583],
28+
["islamic-tbla", -280804, 3, "M03", 22, "bh", 280805, 283583, 5, "M05", 24, "ah", 283583],
29+
["islamic-umalqura", -280804, 3, "M03", 21, "bh", 280805, 283583, 5, "M05", 23, "ah", 283583],
30+
["japanese", -271821, 4, "M04", 19, "bce", 271822, 275760, 9, "M09", 13, "reiwa", 273742],
31+
["persian", -272442, 1, "M01", 9, "ap", -272442, 275139, 7, "M07", 12, "ap", 275139],
32+
["roc", -273732, 4, "M04", 19, "broc", 273733, 273849, 9, "M09", 13, "roc", 273849],
33+
];
34+
35+
for (const [calendar, minYear, minMonth, minMonthCode, minDay, minEra, minEraYear, maxYear, maxMonth, maxMonthCode, maxDay, maxEra, maxEraYear] of testData) {
36+
TemporalHelpers.assertPlainDate(min.withCalendar(calendar),
37+
minYear, minMonth, minMonthCode, minDay,
38+
`${calendar} minimum supported date`,
39+
minEra, minEraYear);
40+
TemporalHelpers.assertPlainDate(max.withCalendar(calendar),
41+
maxYear, maxMonth, maxMonthCode, maxDay,
42+
`${calendar} maximum supported date`,
43+
maxEra, maxEraYear);
44+
}
45+
46+
{
47+
const calendar = "chinese";
48+
const minNonApproximated = new Temporal.PlainDate(1900, 1, 31);
49+
const maxNonApproximated = new Temporal.PlainDate(2101, 1, 28);
50+
TemporalHelpers.assertPlainDate(minNonApproximated.withCalendar(calendar),
51+
1900, 1, "M01", 1, `${calendar} minimum non-approximated date`);
52+
TemporalHelpers.assertPlainDate(maxNonApproximated.withCalendar(calendar),
53+
2100, 12, "M12", 29, `${calendar} maximum non-approximated date`);
54+
55+
// Test that the min and max dates can be created, but don't care about the
56+
// conversion
57+
min.withCalendar(calendar);
58+
max.withCalendar(calendar);
59+
}
60+
61+
{
62+
const calendar = "dangi";
63+
const minNonApproximated = new Temporal.PlainDate(1900, 1, 31);
64+
const maxNonApproximated = new Temporal.PlainDate(2051, 2, 10);
65+
TemporalHelpers.assertPlainDate(minNonApproximated.withCalendar(calendar),
66+
1900, 1, "M01", 1, `${calendar} minimum non-approximated date`);
67+
TemporalHelpers.assertPlainDate(maxNonApproximated.withCalendar(calendar),
68+
2050, 13, "M12", 29, `${calendar} maximum non-approximated date`);
69+
70+
// Test that the min and max dates can be created, but don't care about the
71+
// conversion
72+
min.withCalendar(calendar);
73+
max.withCalendar(calendar);
74+
}
75+
76+
// Additionally test the range of islamic-umalqura in which it does not fall
77+
// back to islamic-civil
78+
{
79+
const calendar = "islamic-umalqura";
80+
const minNonApproximated = new Temporal.PlainDate(1882, 11, 12);
81+
const maxNonApproximated = new Temporal.PlainDate(2077, 11, 16);
82+
TemporalHelpers.assertPlainDate(minNonApproximated.withCalendar(calendar),
83+
1300, 1, "M01", 1, `${calendar} minimum non-approximated date`,
84+
"ah", 1300);
85+
TemporalHelpers.assertPlainDate(maxNonApproximated.withCalendar(calendar),
86+
1500, 12, "M12", 30, `${calendar} maximum non-approximated date`,
87+
"ah", 1500);
88+
}
Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
// Copyright (C) 2025 Igalia, S.L. All rights reserved.
2+
// This code is governed by the BSD license found in the LICENSE file.
3+
4+
/*---
5+
esid: sec-temporal.plaindatetime.from
6+
description: from() gives sensible output at extremes of supported range
7+
features: [Temporal, Intl.Era-monthcode]
8+
includes: [temporalHelpers.js]
9+
---*/
10+
11+
// Lunisolar/lunar calendars can't accurately predict celestial orbits for dates
12+
// far into the past/future. Skip `chinese` and `dangi`. `islamic-umalqura` is
13+
// okay because it is specified to fall back to `islamic-civil` outside the
14+
// range of accuracy.
15+
16+
const testData = [
17+
["buddhist", -271278, 4, "M04", 19, "be", -271278, 276303, 9, "M09", 13, "be", 276303],
18+
["coptic", -272099, 3, "M03", 23, "am", -272099, 275471, 5, "M05", 22, "am", 275471],
19+
["ethioaa", -266323, 3, "M03", 23, "aa", -266323, 281247, 5, "M05", 22, "aa", 281247],
20+
["ethiopic", -271823/*14*/, 3, "M03", 23, "aa", -266323, 275747/*67*/, 5, "M05", 22, "am", 275747/*67*/],
21+
["gregory", -271821, 4, "M04", 19, "bce", 271822, 275760, 9, "M09", 13, "ce", 275760],
22+
["hebrew", -268058, 11, "M11", 4, "am", -268058, 279517, 10, "M09", 11, "am", 279517],
23+
["indian", -271899, 1, "M01", 29, "shaka", -271899, 275682, 6, "M06", 22, "shaka", 275682],
24+
["islamic-civil", -280804, 3, "M03", 21, "bh", 280805, 283583, 5, "M05", 23, "ah", 283583],
25+
["islamic-tbla", -280804, 3, "M03", 22, "bh", 280805, 283583, 5, "M05", 24, "ah", 283583],
26+
["islamic-umalqura", -280804, 3, "M03", 21, "bh", 280805, 283583, 5, "M05", 23, "ah", 283583],
27+
["japanese", -271821, 4, "M04", 19, "bce", 271822, 275760, 9, "M09", 13, "reiwa", 273742],
28+
["persian", -272442, 1, "M01", 9, "ap", -272442, 275139, 7, "M07", 12, "ap", 275139],
29+
["roc", -273732, 4, "M04", 19, "broc", 273733, 273849, 9, "M09", 13, "roc", 273849],
30+
];
31+
32+
for (const [calendar, minYear, minMonth, minMonthCode, minDay, minEra, minEraYear, maxYear, maxMonth, maxMonthCode, maxDay, maxEra, maxEraYear] of testData) {
33+
const min = Temporal.PlainDateTime.from({
34+
calendar,
35+
year: minYear,
36+
era: minEra,
37+
eraYear: minEraYear,
38+
month: minMonth,
39+
monthCode: minMonthCode,
40+
day: minDay,
41+
nanosecond: 1,
42+
});
43+
TemporalHelpers.assertPlainDateTime(min,
44+
minYear, minMonth, minMonthCode, minDay, 0, 0, 0, 0, 0, 1,
45+
`${calendar} minimum supported date`,
46+
minEra, minEraYear);
47+
48+
const max = Temporal.PlainDateTime.from({
49+
calendar,
50+
year: maxYear,
51+
era: maxEra,
52+
eraYear: maxEraYear,
53+
month: maxMonth,
54+
monthCode: maxMonthCode,
55+
day: maxDay,
56+
hour: 23,
57+
minute: 59,
58+
second: 59,
59+
millisecond: 999,
60+
microsecond: 999,
61+
nanosecond: 999,
62+
});
63+
TemporalHelpers.assertPlainDateTime(max,
64+
maxYear, maxMonth, maxMonthCode, maxDay, 23, 59, 59, 999, 999, 999,
65+
`${calendar} maximum supported date`,
66+
maxEra, maxEraYear);
67+
}
68+
69+
{
70+
const calendar = "chinese";
71+
const minNonApproximated = Temporal.PlainDateTime.from({ calendar, year: 1900, month: 1, day: 1 });
72+
const maxNonApproximated = Temporal.PlainDateTime.from({ calendar, year: 2100, month: 12, day: 29, hour: 23, minute: 59, second: 59, millisecond: 999, microsecond: 999, nanosecond: 999 });
73+
TemporalHelpers.assertPlainDateTime(minNonApproximated,
74+
1900, 1, "M01", 1, 0, 0, 0, 0, 0, 0,
75+
`${calendar} minimum non-approximated date`);
76+
TemporalHelpers.assertPlainDateTime(maxNonApproximated,
77+
2100, 12, "M12", 29, 23, 59, 59, 999, 999, 999,
78+
`${calendar} maximum non-approximated date`);
79+
80+
// Create dates far in the past and future but don't care about the conversion
81+
Temporal.PlainDateTime.from({ calendar, year: -250000, month: 1, day: 1 });
82+
Temporal.PlainDateTime.from({ calendar, year: 250000, month: 1, day: 1 });
83+
}
84+
85+
{
86+
const calendar = "dangi";
87+
const minNonApproximated = Temporal.PlainDateTime.from({ calendar, year: 1900, month: 1, day: 1 });
88+
const maxNonApproximated = Temporal.PlainDateTime.from({ calendar, year: 2050, month: 13, day: 29, hour: 23, minute: 59, second: 59, millisecond: 999, microsecond: 999, nanosecond: 999 });
89+
TemporalHelpers.assertPlainDateTime(minNonApproximated,
90+
1900, 1, "M01", 1, 0, 0, 0, 0, 0, 0, `${calendar} minimum non-approximated date`);
91+
TemporalHelpers.assertPlainDateTime(maxNonApproximated,
92+
2050, 13, "M12", 29, 23, 59, 59, 999, 999, 999, `${calendar} maximum non-approximated date`);
93+
94+
// Create dates far in the past and future but don't care about the conversion
95+
Temporal.PlainDateTime.from({ calendar, year: -250000, month: 1, day: 1 });
96+
Temporal.PlainDateTime.from({ calendar, year: 250000, month: 1, day: 1 });
97+
}
98+
99+
// Additionally test the range of islamic-umalqura in which it does not fall
100+
// back to islamic-civil
101+
{
102+
const calendar = "islamic-umalqura";
103+
const minNonApproximated = Temporal.PlainDateTime.from({ calendar, year: 1300, month: 1, day: 1 });
104+
const maxNonApproximated = Temporal.PlainDateTime.from({ calendar, year: 1500, month: 12, day: 30, hour: 23, minute: 59, second: 59, millisecond: 999, microsecond: 999, nanosecond: 999 });
105+
TemporalHelpers.assertPlainDateTime(minNonApproximated,
106+
1300, 1, "M01", 1, 0, 0, 0, 0, 0, 0, `${calendar} minimum non-approximated date`,
107+
"ah", 1300);
108+
TemporalHelpers.assertPlainDateTime(maxNonApproximated,
109+
1500, 12, "M12", 30, 23, 59, 59, 999, 999, 999, `${calendar} maximum non-approximated date`,
110+
"ah", 1500);
111+
}
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
// Copyright (C) 2025 Igalia, S.L. All rights reserved.
2+
// This code is governed by the BSD license found in the LICENSE file.
3+
4+
/*---
5+
esid: sec-temporal.plaindate.prototype.withcalendar
6+
description: withCalendar gives sensible output at extremes of supported range
7+
features: [Temporal, Intl.Era-monthcode]
8+
includes: [temporalHelpers.js]
9+
---*/
10+
11+
const min = new Temporal.PlainDateTime(-271821, 4, 19, 0, 0, 0, 0, 0, 1);
12+
const max = new Temporal.PlainDateTime(275760, 9, 13, 23, 59, 59, 999, 999, 999);
13+
14+
// Lunisolar/lunar calendars can't accurately predict celestial orbits for dates
15+
// far into the past/future. Skip `chinese` and `dangi`. `islamic-umalqura` is
16+
// okay because it is specified to fall back to `islamic-civil` outside the
17+
// range of accuracy.
18+
19+
const testData = [
20+
["buddhist", -271278, 4, "M04", 19, "be", -271278, 276303, 9, "M09", 13, "be", 276303],
21+
["coptic", -272099, 3, "M03", 23, "am", -272099, 275471, 5, "M05", 22, "am", 275471],
22+
["ethioaa", -266323, 3, "M03", 23, "aa", -266323, 281247, 5, "M05", 22, "aa", 281247],
23+
["ethiopic", -271814, 3, "M03", 23, "aa", -266323, 275767, 5, "M05", 22, "am", 275767],
24+
["gregory", -271821, 4, "M04", 19, "bce", 271822, 275760, 9, "M09", 13, "ce", 275760],
25+
["hebrew", -268058, 11, "M11", 4, "am", -268058, 279517, 10, "M09", 11, "am", 279517],
26+
["indian", -271899, 1, "M01", 29, "shaka", -271899, 275682, 6, "M06", 22, "shaka", 275682],
27+
["islamic-civil", -280804, 3, "M03", 21, "bh", 280805, 283583, 5, "M05", 23, "ah", 283583],
28+
["islamic-tbla", -280804, 3, "M03", 22, "bh", 280805, 283583, 5, "M05", 24, "ah", 283583],
29+
["islamic-umalqura", -280804, 3, "M03", 21, "bh", 280805, 283583, 5, "M05", 23, "ah", 283583],
30+
["japanese", -271821, 4, "M04", 19, "bce", 271822, 275760, 9, "M09", 13, "reiwa", 273742],
31+
["persian", -272442, 1, "M01", 9, "ap", -272442, 275139, 7, "M07", 12, "ap", 275139],
32+
["roc", -273732, 4, "M04", 19, "broc", 273733, 273849, 9, "M09", 13, "roc", 273849],
33+
];
34+
35+
for (const [calendar, minYear, minMonth, minMonthCode, minDay, minEra, minEraYear, maxYear, maxMonth, maxMonthCode, maxDay, maxEra, maxEraYear] of testData) {
36+
TemporalHelpers.assertPlainDateTime(min.withCalendar(calendar),
37+
minYear, minMonth, minMonthCode, minDay, 0, 0, 0, 0, 0, 1,
38+
`${calendar} minimum supported date`,
39+
minEra, minEraYear);
40+
TemporalHelpers.assertPlainDateTime(max.withCalendar(calendar),
41+
maxYear, maxMonth, maxMonthCode, maxDay, 23, 59, 59, 999, 999, 999,
42+
`${calendar} maximum supported date`,
43+
maxEra, maxEraYear);
44+
}
45+
46+
{
47+
const calendar = "chinese";
48+
const minNonApproximated = new Temporal.PlainDateTime(1900, 1, 31);
49+
const maxNonApproximated = new Temporal.PlainDateTime(2101, 1, 28, 23, 59, 59, 999, 999, 999);
50+
TemporalHelpers.assertPlainDateTime(minNonApproximated.withCalendar(calendar),
51+
1900, 1, "M01", 1, 0, 0, 0, 0, 0, 0,
52+
`${calendar} minimum non-approximated date`);
53+
TemporalHelpers.assertPlainDateTime(maxNonApproximated.withCalendar(calendar),
54+
2100, 12, "M12", 29, 23, 59, 59, 999, 999, 999,
55+
`${calendar} maximum non-approximated date`);
56+
57+
// Test that the min and max dates can be created, but don't care about the
58+
// conversion
59+
min.withCalendar(calendar);
60+
max.withCalendar(calendar);
61+
}
62+
63+
{
64+
const calendar = "dangi";
65+
const minNonApproximated = new Temporal.PlainDateTime(1900, 1, 31);
66+
const maxNonApproximated = new Temporal.PlainDateTime(2051, 2, 10, 23, 59, 59, 999, 999, 999);
67+
TemporalHelpers.assertPlainDateTime(minNonApproximated.withCalendar(calendar),
68+
1900, 1, "M01", 1, 0, 0, 0, 0, 0, 0,
69+
`${calendar} minimum non-approximated date`);
70+
TemporalHelpers.assertPlainDateTime(maxNonApproximated.withCalendar(calendar),
71+
2050, 13, "M12", 29, 23, 59, 59, 999, 999, 999,
72+
`${calendar} maximum non-approximated date`);
73+
74+
// Test that the min and max dates can be created, but don't care about the
75+
// conversion
76+
min.withCalendar(calendar);
77+
max.withCalendar(calendar);
78+
}
79+
80+
// Additionally test the range of islamic-umalqura in which it does not fall
81+
// back to islamic-civil
82+
{
83+
const calendar = "islamic-umalqura";
84+
const minNonApproximated = new Temporal.PlainDateTime(1882, 11, 12);
85+
const maxNonApproximated = new Temporal.PlainDateTime(2077, 11, 16, 23, 59, 59, 999, 999, 999);
86+
TemporalHelpers.assertPlainDateTime(minNonApproximated.withCalendar(calendar),
87+
1300, 1, "M01", 1, 0, 0, 0, 0, 0, 0,
88+
`${calendar} minimum non-approximated date`,
89+
"ah", 1300);
90+
TemporalHelpers.assertPlainDateTime(maxNonApproximated.withCalendar(calendar),
91+
1500, 12, "M12", 30, 23, 59, 59, 999, 999, 999,
92+
`${calendar} maximum non-approximated date`,
93+
"ah", 1500);
94+
}

0 commit comments

Comments
 (0)