Skip to content

Commit 3e0709c

Browse files
targosMylesBorins
authored andcommitted
deps: V8: backport fb63e5cf55e9
Original commit message: [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 <[email protected]> Commit-Queue: Frank Tang <[email protected]> Cr-Commit-Position: refs/heads/master@{#60379} Refs: v8/v8@fb63e5c Fixes: #30369 Backport-PR-URL: #30372
1 parent 0f3ae77 commit 3e0709c

File tree

3 files changed

+23
-2
lines changed

3 files changed

+23
-2
lines changed

common.gypi

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333

3434
# Reset this number to 0 on major V8 upgrades.
3535
# Increment by one for each non-official patch applied to deps/v8.
36-
'v8_embedder_string': '-node.54',
36+
'v8_embedder_string': '-node.55',
3737

3838
# Enable disassembler for `--print-code` v8 options
3939
'v8_enable_disassembler': 1,

deps/v8/src/objects/intl-objects.cc

+3-1
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,9 @@ icu::SimpleDateFormat* CreateICUDateFormat(Isolate* isolate,
138138
status));
139139
icu::UnicodeString pattern;
140140
if (U_SUCCESS(status))
141-
pattern = generator->getBestPattern(skeleton, status);
141+
pattern = generator->getBestPattern(skeleton,
142+
UDATPG_MATCH_HOUR_FIELD_LENGTH,
143+
status);
142144

143145
date_format = new icu::SimpleDateFormat(pattern, icu_locale, status);
144146
if (U_SUCCESS(status)) {

deps/v8/test/intl/regress-527926.js

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// Copyright 2019 the V8 project authors. All rights reserved.
2+
// Use of this source code is governed by a BSD-style license that can be
3+
// found in the LICENSE file.
4+
5+
let date = new Date(2015, 8, 1, 3, 0, 0);
6+
var fmt = new Intl.DateTimeFormat('ru', {hour:'2-digit', minute: '2-digit'})
7+
assertEquals("03:00", fmt.format(date));
8+
9+
fmt = new Intl.DateTimeFormat(
10+
'en', {hour:'2-digit', minute: '2-digit', hour12: false});
11+
assertEquals("03:00", fmt.format(date));
12+
13+
fmt = new Intl.DateTimeFormat(
14+
'ru', {hour:'2-digit', minute: '2-digit', hour12: false});
15+
assertEquals("03:00", fmt.format(date));
16+
17+
fmt = new Intl.DateTimeFormat(
18+
'ru', {hour:'2-digit', minute: '2-digit', hour12: true});
19+
assertEquals("03:00 AM", fmt.format(date));

0 commit comments

Comments
 (0)