Source code

Revision control

Copy as Markdown

Other Tools

// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally
// Copyright (C) 2026 Igalia, S.L. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-temporal.plaindate.from
description: >
The ISO date of Nowruz (1 Farvardin) for Persian years 1206–1498 AP matches
the data published by the Iranian calendar authority
info: |
The Iranian calendar authority has published the Gregorian date of 1 Farvardin
for each Persian year from 1206 to 1498 AP.
includes: [temporalHelpers.js]
features: [Temporal, Intl.Era-monthcode]
---*/
// [persianYear, isoDay] pairs from the Iranian calendar authority
// (Nowruz always falls in March; ISO year is persianYear + 621)
const nowruzDates = [
[1206, 22],
[1207, 21],
[1208, 21],
[1209, 21],
[1210, 21],
[1211, 21],
[1212, 21],
[1213, 21],
[1214, 21],
[1215, 21],
[1216, 21],
[1217, 21],
[1218, 21],
[1219, 21],
[1220, 21],
[1221, 21],
[1222, 21],
[1223, 21],
[1224, 21],
[1225, 21],
[1226, 21],
[1227, 21],
[1228, 21],
[1229, 21],
[1230, 21],
[1231, 21],
[1232, 21],
[1233, 21],
[1234, 21],
[1235, 21],
[1236, 21],
[1237, 21],
[1238, 21],
[1239, 21],
[1240, 21],
[1241, 21],
[1242, 21],
[1243, 20],
[1244, 21],
[1245, 21],
[1246, 21],
[1247, 20],
[1248, 21],
[1249, 21],
[1250, 21],
[1251, 20],
[1252, 21],
[1253, 21],
[1254, 21],
[1255, 20],
[1256, 21],
[1257, 21],
[1258, 21],
[1259, 20],
[1260, 21],
[1261, 21],
[1262, 21],
[1263, 20],
[1264, 21],
[1265, 21],
[1266, 21],
[1267, 20],
[1268, 21],
[1269, 21],
[1270, 21],
[1271, 20],
[1272, 21],
[1273, 21],
[1274, 21],
[1275, 20],
[1276, 20],
[1277, 21],
[1278, 21],
[1279, 21],
[1280, 21],
[1281, 22],
[1282, 22],
[1283, 21],
[1284, 21],
[1285, 22],
[1286, 22],
[1287, 21],
[1288, 21],
[1289, 22],
[1290, 22],
[1291, 21],
[1292, 21],
[1293, 22],
[1294, 22],
[1295, 21],
[1296, 21],
[1297, 22],
[1298, 22],
[1299, 21],
[1300, 21],
[1301, 22],
[1302, 22],
[1303, 21],
[1304, 21],
[1305, 22],
[1306, 22],
[1307, 21],
[1308, 21],
[1309, 21],
[1310, 22],
[1311, 21],
[1312, 21],
[1313, 21],
[1314, 22],
[1315, 21],
[1316, 21],
[1317, 21],
[1318, 22],
[1319, 21],
[1320, 21],
[1321, 21],
[1322, 22],
[1323, 21],
[1324, 21],
[1325, 21],
[1326, 22],
[1327, 21],
[1328, 21],
[1329, 21],
[1330, 22],
[1331, 21],
[1332, 21],
[1333, 21],
[1334, 22],
[1335, 21],
[1336, 21],
[1337, 21],
[1338, 22],
[1339, 21],
[1340, 21],
[1341, 21],
[1342, 21],
[1343, 21],
[1344, 21],
[1345, 21],
[1346, 21],
[1347, 21],
[1348, 21],
[1349, 21],
[1350, 21],
[1351, 21],
[1352, 21],
[1353, 21],
[1354, 21],
[1355, 21],
[1356, 21],
[1357, 21],
[1358, 21],
[1359, 21],
[1360, 21],
[1361, 21],
[1362, 21],
[1363, 21],
[1364, 21],
[1365, 21],
[1366, 21],
[1367, 21],
[1368, 21],
[1369, 21],
[1370, 21],
[1371, 21],
[1372, 21],
[1373, 21],
[1374, 21],
[1375, 20],
[1376, 21],
[1377, 21],
[1378, 21],
[1379, 20],
[1380, 21],
[1381, 21],
[1382, 21],
[1383, 20],
[1384, 21],
[1385, 21],
[1386, 21],
[1387, 20],
[1388, 21],
[1389, 21],
[1390, 21],
[1391, 20],
[1392, 21],
[1393, 21],
[1394, 21],
[1395, 20],
[1396, 21],
[1397, 21],
[1398, 21],
[1399, 20],
[1400, 21],
[1401, 21],
[1402, 21],
[1403, 20],
[1404, 21],
[1405, 21],
[1406, 21],
[1407, 20],
[1408, 20],
[1409, 21],
[1410, 21],
[1411, 20],
[1412, 20],
[1413, 21],
[1414, 21],
[1415, 20],
[1416, 20],
[1417, 21],
[1418, 21],
[1419, 20],
[1420, 20],
[1421, 21],
[1422, 21],
[1423, 20],
[1424, 20],
[1425, 21],
[1426, 21],
[1427, 20],
[1428, 20],
[1429, 21],
[1430, 21],
[1431, 20],
[1432, 20],
[1433, 21],
[1434, 21],
[1435, 20],
[1436, 20],
[1437, 21],
[1438, 21],
[1439, 20],
[1440, 20],
[1441, 20],
[1442, 21],
[1443, 20],
[1444, 20],
[1445, 20],
[1446, 21],
[1447, 20],
[1448, 20],
[1449, 20],
[1450, 21],
[1451, 20],
[1452, 20],
[1453, 20],
[1454, 21],
[1455, 20],
[1456, 20],
[1457, 20],
[1458, 21],
[1459, 20],
[1460, 20],
[1461, 20],
[1462, 21],
[1463, 20],
[1464, 20],
[1465, 20],
[1466, 21],
[1467, 20],
[1468, 20],
[1469, 20],
[1470, 21],
[1471, 20],
[1472, 20],
[1473, 20],
[1474, 20],
[1475, 20],
[1476, 20],
[1477, 20],
[1478, 20],
[1479, 21],
[1480, 21],
[1481, 21],
[1482, 21],
[1483, 21],
[1484, 21],
[1485, 21],
[1486, 21],
[1487, 21],
[1488, 21],
[1489, 21],
[1490, 21],
[1491, 21],
[1492, 21],
[1493, 21],
[1494, 21],
[1495, 21],
[1496, 21],
[1497, 21],
[1498, 21],
];
for (const [persianYear, expectedDay] of nowruzDates) {
const date = Temporal.PlainDate.from({
year: persianYear,
month: 1,
day: 1,
calendar: "persian"
});
const isoDate = date.withCalendar("iso8601");
TemporalHelpers.assertPlainDate(
isoDate,
persianYear + 621, 3, "M03", expectedDay,
"Nowruz (1 Farvardin) of Persian year " + persianYear
);
}
reportCompare(0, 0);