f6d2255a03
This is a reland of 915f729afb
Original change's description:
> Add regression tests for 4 calendar bugs
>
> These bugs was fixed by ICU68
>
> Bug: v8:10526, v8:10527, v8:10528, v8:10529
> Change-Id: I8d0dcb52d849f742e0a29314ac8a148370f60a1a
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2527086
> Reviewed-by: Shu-yu Guo <syg@chromium.org>
> Commit-Queue: Frank Tang <ftang@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#71062}
Cq-Include-Trybots: luci.v8.try:v8_android_arm64_n5x_rel_ng
Bug: v8:10526
Bug: v8:10527
Bug: v8:10528
Bug: v8:10529
Change-Id: I8857fb8c104bb4bede8fe816574bfd46ccbcd082
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2536737
Commit-Queue: Frank Tang <ftang@chromium.org>
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71244}
22 lines
1.0 KiB
JavaScript
22 lines
1.0 KiB
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 islamic-umalqura calendar of date prior to
|
||
// -195366-07-23
|
||
// On Android, islamic-umalqura calendar is only available on ar and fa locales.
|
||
let dateOK = new Date (Date.UTC(-195366, 6, 23));
|
||
let dateKO = new Date (Date.UTC(-195366, 6, 22));
|
||
let dateDisplay = new Intl.DateTimeFormat (
|
||
'ar-u-ca-islamic-umalqura',
|
||
{ timeZone : 'UTC', year : 'numeric', month :'long',
|
||
day : 'numeric', weekday : 'long' });
|
||
assertEquals("Wed, 23 Jul -195366 00:00:00 GMT",
|
||
dateOK.toUTCString(), "dateOK.toUTCString()");
|
||
assertEquals("Tue, 22 Jul -195366 00:00:00 GMT",
|
||
dateKO.toUTCString(), "dateKO.toUTCString()");
|
||
assertEquals("الأربعاء، 17 ذو الحجة -202003 هـ",
|
||
dateDisplay.format(dateOK), "dateDisplay.format(dateOK)");
|
||
assertEquals("الثلاثاء، 16 ذو الحجة -202003 هـ",
|
||
dateDisplay.format(dateKO), "dateDisplay.format(dateKO)");
|