argument-string-calendar-annotation.js (1119B)
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: Various forms of calendar annotation; critical flag has no effect 8 features: [Temporal] 9 includes: [temporalHelpers.js] 10 ---*/ 11 12 const tests = [ 13 ["2000-05-02[u-ca=iso8601]", "without time or time zone"], 14 ["2000-05-02[UTC][u-ca=iso8601]", "with time zone and no time"], 15 ["2000-05-02T15:23[u-ca=iso8601]", "without time zone"], 16 ["2000-05-02T15:23[UTC][u-ca=iso8601]", "with time zone"], 17 ["2000-05-02T15:23[!u-ca=iso8601]", "with ! and no time zone"], 18 ["2000-05-02T15:23[UTC][!u-ca=iso8601]", "with ! and time zone"], 19 ["2000-05-02T15:23[u-ca=iso8601][u-ca=discord]", "second annotation ignored"], 20 ]; 21 22 tests.forEach(([arg, description]) => { 23 const result = Temporal.PlainDate.from(arg); 24 25 TemporalHelpers.assertPlainDate( 26 result, 27 2000, 5, "M05", 2, 28 `calendar annotation (${description})` 29 ); 30 }); 31 32 reportCompare(0, 0);