v8/test/intl/regress-527926.js
Frank Tang 08c469719c [intl] Migrate to ICU 72
DEPS change in chromium is in
https://chromium-review.googlesource.com/c/chromium/src/+/3995549
and should be landed first.

This CL fix all the broken test in v8.

ICU72 release note https://icu.unicode.org/download/72
CLDR42 release note https://cldr.unicode.org/index/downloads/cldr-42

Key changes
1. Fix the test expectation for the formatted date string
a. use U+202f (narrow nbsp) before "PM" and "AM".
b. use U+200A (thin space) around U+2013 in date duration format.
2. Mark the test262 breakage.

Bug: chromium:1371208
Change-Id: I4e2ecc6330845a2bf86711bc4ee6fe6407f140c1
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4004606
Commit-Queue: Frank Tang <ftang@chromium.org>
Reviewed-by: Shu-yu Guo <syg@chromium.org>
Cr-Commit-Position: refs/heads/main@{#84374}
2022-11-21 07:04:20 +00:00

20 lines
743 B
JavaScript

// Copyright 2019 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.
let date = new Date(2015, 8, 1, 3, 0, 0);
var fmt = new Intl.DateTimeFormat('ru', {hour:'2-digit', minute: '2-digit'})
assertEquals("03:00", fmt.format(date));
fmt = new Intl.DateTimeFormat(
'en', {hour:'2-digit', minute: '2-digit', hour12: false});
assertEquals("03:00", fmt.format(date));
fmt = new Intl.DateTimeFormat(
'ru', {hour:'2-digit', minute: '2-digit', hour12: false});
assertEquals("03:00", fmt.format(date));
fmt = new Intl.DateTimeFormat(
'ru', {hour:'2-digit', minute: '2-digit', hour12: true});
assertEquals("03:00\u202fAM", fmt.format(date));