tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

basic-hebrew.js (1297B)


      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.plaindate.from
      7 description: Basic functionality of resolving fields in hebrew calendar
      8 features: [Temporal, Intl.Era-monthcode]
      9 includes: [temporalHelpers.js]
     10 ---*/
     11 
     12 const calendar = "hebrew";
     13 const options = { overflow: "reject" };
     14 
     15 const commonYear = 5783;
     16 const monthLengths5783 = [undefined, 30, 30, 30, 29, 30, 29, 30, 29, 30, 29, 30, 29];
     17 
     18 for (let month = 1; month < 13; month++) {
     19  const monthCode = `M${String(month).padStart(2, '0')}`;
     20 
     21  const startOfMonth = Temporal.PlainDate.from({ year: commonYear, month, day: 1, calendar }, options);
     22  TemporalHelpers.assertPlainDate(
     23    startOfMonth,
     24    commonYear, month, monthCode, 1,
     25    `Start of month ${monthCode} in common year`,
     26    "am", commonYear
     27  );
     28 
     29  const day = monthLengths5783[month];
     30  const endOfMonth = Temporal.PlainDate.from({ year: commonYear, month, day, calendar }, options);
     31  TemporalHelpers.assertPlainDate(
     32    endOfMonth,
     33    commonYear, month, monthCode, day,
     34    `End of month ${monthCode} in common year`,
     35    "am", commonYear
     36  );
     37 }
     38 
     39 
     40 reportCompare(0, 0);