v8/test/intl/regress-10529.js
Frank Tang b9a48232b7 [Intl] Update ICU to 70-1 on v8
Diary  https://docs.google.com/document/d/1NqMw7DAVFCZRx67auC7sgOvrikHvCYuaB87JUf21yG8/edit#
eedbaf76..3e05d9da

chromium roll in https://chromium-review.googlesource.com/c/chromium/src/+/3224333

Bug: chromium:1260116
Change-Id: Ie1922a129310106985f3bf1bffd9101fce6bb73a
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3237532
Reviewed-by: Shu-yu Guo <syg@chromium.org>
Commit-Queue: Frank Tang <ftang@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77868}
2021-11-12 11:35:09 +00:00

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)");