Commit b90717df authored by Leszek Swirski's avatar Leszek Swirski Committed by Commit Bot

[intl] Fix timezone bug in test

If we're testing printing in UTC timezone, then we have to be careful to
also input the date in UTC, else local timezone will affect the test.

Fixed: chromium:1135116
Change-Id: I49981c263e7b1fa1492b4644c5d4846fd94e5613
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2448793
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Auto-Submit: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: 's avatarSantiago Aboy Solanes <solanes@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70312}
parent cdb3da7f
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
let d1 = new Date("2019-05-23T00:00"); let d1 = new Date(Date.UTC(2019, 4, 23));
// Ensure calendar: "japanese" under "ja" locale is correct. // Ensure calendar: "japanese" under "ja" locale is correct.
assertEquals("R1/5/23", d1.toLocaleDateString( assertEquals("R1/5/23", d1.toLocaleDateString(
...@@ -21,7 +21,7 @@ assertEquals("R1/5/23", d1.toLocaleDateString( ...@@ -21,7 +21,7 @@ assertEquals("R1/5/23", d1.toLocaleDateString(
"ja", {calendar: "japanese", timeZone:"UTC", dateStyle: "short"})); "ja", {calendar: "japanese", timeZone:"UTC", dateStyle: "short"}));
// Ensure calendar: "chinese" under "zh" locale is correct. // Ensure calendar: "chinese" under "zh" locale is correct.
d1 = new Date("2020-05-23T00:00"); d1 = new Date(Date.UTC(2020, 4, 23));
assertEquals("2020年闰四月1", d1.toLocaleDateString( assertEquals("2020年闰四月1", d1.toLocaleDateString(
"zh", {calendar: "chinese", timeZone:"UTC"})); "zh", {calendar: "chinese", timeZone:"UTC"}));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment