mirror of
https://github.com/nodejs/node.git
synced 2025-05-17 00:33:26 +00:00

PR-URL: https://github.com/nodejs/node/pull/41610 Reviewed-By: Jiawen Geng <technicalcute@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Darshan Sen <raisinten@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
21 lines
1021 B
JavaScript
21 lines
1021 B
JavaScript
// Copyright 2020 the V8 project authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
// found in the LICENSE file.
|
|
|
|
// Test date format in Indian calendar of date prior to 0001-01-01
|
|
// On Android, indian calendar is only available on hi locale.
|
|
let dateOK = new Date ("0001-12-31T23:52:58.000Z");
|
|
let dateKO = new Date ("0000-12-30T23:52:58.000Z");
|
|
let dateDisplay = new Intl.DateTimeFormat (
|
|
'hi-u-ca-indian',
|
|
{ timeZone : 'UTC', era: 'long', year : 'numeric', month :'long',
|
|
day : 'numeric', weekday : 'long' });
|
|
assertEquals("Mon, 31 Dec 0001 23:52:58 GMT",
|
|
dateOK.toUTCString(), "dateOK.toUTCString()");
|
|
assertEquals("Sat, 30 Dec 0000 23:52:58 GMT",
|
|
dateKO.toUTCString(), "dateKO.toUTCString()");
|
|
assertEquals("सोमवार, 10 पौष -77 शक",
|
|
dateDisplay.format(dateOK), "dateDisplay.format(dateOK)");
|
|
assertEquals("शनिवार, 9 पौष -78 शक",
|
|
dateDisplay.format(dateKO), "dateDisplay.format(dateKO)");
|