Skip to content
Permalink
Browse files

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

Backport-PR-URL: #30372
  • Loading branch information
targos authored and MylesBorins committed Nov 12, 2019
1 parent 0f3ae77 commit 3e0709cf5e7b6a44c9b84cb9144dd41ee54cb932
Showing with 23 additions and 2 deletions.
  1. +1 −1 common.gypi
  2. +3 −1 deps/v8/src/objects/intl-objects.cc
  3. +19 −0 deps/v8/test/intl/regress-527926.js
@@ -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,
@@ -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)) {
@@ -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));

0 comments on commit 3e0709c

Please sign in to comment.
You can’t perform that action at this time.