tor-browser

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

argument-zoneddatetime.js (740B)


      1 // |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally
      2 // Copyright (C) 2022 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: A ZonedDateTime object is handled separately
      8 includes: [temporalHelpers.js]
      9 features: [Temporal]
     10 ---*/
     11 
     12 const calendar = "iso8601";
     13 const zdt = new Temporal.ZonedDateTime(1_000_000_000_987_654_321n, "UTC", calendar);
     14 const result = Temporal.PlainDate.from(zdt);
     15 
     16 TemporalHelpers.assertPlainDate(
     17  result,
     18  2001, 9, "M09", 9,
     19  "ZonedDateTime is converted"
     20 );
     21 
     22 assert.sameValue(
     23  result.calendarId,
     24  calendar,
     25  "Calendar is copied"
     26 );
     27 
     28 reportCompare(0, 0);