Add a test for PlainDateTime#toPlainDate().

This commit is contained in:
Ms2ger 2021-12-28 11:05:14 +01:00 committed by Rick Waldron
parent 83bffcc6fd
commit 88f2eb7329
1 changed files with 18 additions and 0 deletions

View File

@ -0,0 +1,18 @@
// Copyright (C) 2021 Igalia, S.L. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-temporal.plaindatetime.prototype.toplaindate
description: toPlainDate works at the edges of the supported range
includes: [temporalHelpers.js]
features: [Temporal]
---*/
const min = Temporal.PlainDateTime.from('-271821-04-19T00:00:00.000000001');
TemporalHelpers.assertPlainDate(min.toPlainDate(),
-271821, 4, "M04", 19, "min");
const max = Temporal.PlainDateTime.from('+275760-09-13T23:59:59.999999999');
TemporalHelpers.assertPlainDate(max.toPlainDate(),
275760, 9, "M09", 13, "max");