[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: Santiago Aboy Solanes <solanes@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70312}
This commit is contained in:
Leszek Swirski 2020-10-05 14:48:38 +02:00 committed by Commit Bot
parent cdb3da7f5f
commit b90717df29

View File

@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// 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.
assertEquals("R1/5/23", d1.toLocaleDateString(
@ -21,7 +21,7 @@ assertEquals("R1/5/23", d1.toLocaleDateString(
"ja", {calendar: "japanese", timeZone:"UTC", dateStyle: "short"}));
// 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(
"zh", {calendar: "chinese", timeZone:"UTC"}));