Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 <gsathya@chromium.org>
    Commit-Queue: Frank Tang <ftang@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#60379}

Refs: v8/v8@fb63e5c

Fixes: #30369
  • Loading branch information
targos committed Nov 12, 2019
commit ded973a1d29a498d48cd8e02e7308e07da9f8353
2 changes: 1 addition & 1 deletion common.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

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

# Enable disassembler for `--print-code` v8 options
'v8_enable_disassembler': 1,
Expand Down
4 changes: 3 additions & 1 deletion deps/v8/src/objects/intl-objects.cc
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,9 @@ icu::SimpleDateFormat* CreateICUDateFormat(Isolate* isolate,
status));
icu::UnicodeString pattern;
if (U_SUCCESS(status))
pattern = generator->getBestPattern(skeleton, status);
pattern = generator->getBestPattern(skeleton,
UDATPG_MATCH_HOUR_FIELD_LENGTH,
status);

date_format = new icu::SimpleDateFormat(pattern, icu_locale, status);
if (U_SUCCESS(status)) {
Expand Down
19 changes: 19 additions & 0 deletions deps/v8/test/intl/regress-527926.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// 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));