summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/built-ins/Temporal/Calendar/prototype/yearOfWeek/cross-year.js
blob: 1ca8d9baffcb0f761afc3e24b46c1a70d397b360 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally
// Copyright (C) 2022 Igalia, S.L. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.

/*---
esid: sec-temporal.calendar.prototype.yearOfWeek
description: yearOfWeek() where the result is different from the calendar year
features: [Temporal]
---*/

const iso = Temporal.Calendar.from("iso8601");
assert.sameValue(iso.yearOfWeek(Temporal.PlainDate.from("2019-12-31")), 2020, "next year");
assert.sameValue(iso.yearOfWeek(Temporal.PlainDate.from("2021-01-01")), 2020, "previous year");

reportCompare(0, 0);