leap-months-hebrew.js (1670B)
1 // |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally 2 // Copyright (C) 2025 Igalia, S.L. All rights reserved. 3 // This code is governed by the BSD license found in the LICENSE file. 4 5 /*--- 6 esid: sec-temporal.zoneddatetime.from 7 description: Test valid leap months when resolving fields in hebrew calendar 8 features: [Temporal, Intl.Era-monthcode] 9 includes: [temporalHelpers.js] 10 ---*/ 11 12 const calendar = "hebrew"; 13 14 // Valid leap month: Adar I 5779 15 TemporalHelpers.assertPlainDateTime( 16 Temporal.ZonedDateTime.from({ year: 5779, month: 6, day: 1, hour: 12, minute: 34, timeZone: "UTC", calendar }).toPlainDateTime(), 17 5779, 6, "M05L", 1, 12, 34, 0, 0, 0, 0, 18 "Leap month resolved from month number", 19 "am", 5779); 20 TemporalHelpers.assertPlainDateTime( 21 Temporal.ZonedDateTime.from({ year: 5779, monthCode: "M05L", day: 1, hour: 12, minute: 34, timeZone: "UTC", calendar }).toPlainDateTime(), 22 5779, 6, "M05L", 1, 12, 34, 0, 0, 0, 0, 23 "Leap month resolved from month code", 24 "am", 5779); 25 26 // Creating dates in later months in a leap year 27 TemporalHelpers.assertPlainDateTime( 28 Temporal.ZonedDateTime.from({ year: 5779, month: 7, day: 1, hour: 12, minute: 34, timeZone: "UTC", calendar }).toPlainDateTime(), 29 5779, 7, "M06", 1, 12, 34, 0, 0, 0, 0, 30 "Month after leap month resolved from month number", 31 "am", 5779); 32 TemporalHelpers.assertPlainDateTime( 33 Temporal.ZonedDateTime.from({ year: 5779, monthCode: "M06", day: 1, hour: 12, minute: 34, timeZone: "UTC", calendar }).toPlainDateTime(), 34 5779, 7, "M06", 1, 12, 34, 0, 0, 0, 0, 35 "Month after leap month resolved from month code", 36 "am", 5779); 37 38 reportCompare(0, 0);