1 // |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally
2 // Copyright (C) 2024 Igalia, S.L. All rights reserved.
3 // This code is governed by the BSD license found in the LICENSE file.
6 esid: sec-temporal.calendar.prototype.yearofweek
8 Temporal.Calendar.prototype.yearOfWeek returns undefined for all
9 non-ISO calendars without a well-defined week numbering system.
13 // Gregorian calendar has a well defined week-numbering system.
15 let calendar = new Temporal.Calendar("gregory");
16 const date = { month: 1, day: 1, year: 2024, calendar};
18 assert.sameValue(calendar.yearOfWeek({...date}), 2024);
20 calendar = new Temporal.Calendar("hebrew");
21 const nonisodate = { month: 1, day: 1, year: 2024, calendar};
23 assert.sameValue(calendar.yearOfWeek({...nonisodate}), undefined);