v8/test/intl/regress-527926.js
Frank Tang fb63e5cf55 [Intl] Fix output of hour:'2-digit', hour12: true
Bug: chromium:527926
Change-Id: I783ba59c6e4b117163e058032fb04283e1f43c46
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1529260
Reviewed-by: Sathya Gunasekaran <gsathya@chromium.org>
Commit-Queue: Frank Tang <ftang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#60379}
2019-03-21 07:34:22 +00:00

20 lines
738 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 AM", fmt.format(date));