Skip to content

Commit

Permalink
Migrating ICU from 71 to 72
Browse files Browse the repository at this point in the history
ICU72 release note https://icu.unicode.org/download/72
CLDR42 release note https://cldr.unicode.org/index/downloads/cldr-42
Unicode15 release note https://blog.unicode.org/2022/09/announcing-unicode-standard-version-150.html

Changing test expectation:
1. Use THIN SPACE (U+202F) for the space before "AM/PM" in
date formatting.
2. Bidi control code around some dash in date format output. Change the space around – \u2013 U+2013 "En Dash" from ASCII SPACE to \u2009 "Thin Space"
3. @ is now consider part of a word.


ICU 72 migration diary
https://docs.google.com/document/d/1bzme4zR_swaqMoJIYLL9wwk-rsjdAdjGrU073h0TJbo

Ref about 2009 https://www.compart.com/en/unicode/U+2009
Ref about 202f https://www.compart.com/en/unicode/U+202f

Size Impact due to increase of more unicode characters and localized patterns:
- Fuchsia web_engine +16384 bytes compressed
- Fuchsia chrome_fuchsia +24576 bytes compressed
- Android Normalized APK Size: +107854 bytes

Bug: 1371208
Binary-Size: Size increase is unavoidable (see above).
Fuchsia-Binary-Size: Size increase is unavoidable.
Change-Id: Ic8dccaceecbf348e74880286d903320ab6983541
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3995549
Reviewed-by: Orin Jaworski <orinj@chromium.org>
Reviewed-by: Daniel Libby <dlibby@microsoft.com>
Reviewed-by: Luca Hunkeler <hluca@google.com>
Reviewed-by: Kent Tamura <tkent@chromium.org>
Reviewed-by: Peter Marshall <petermarshall@chromium.org>
Commit-Queue: Frank Tang <ftang@chromium.org>
Reviewed-by: Pavol Marko <pmarko@chromium.org>
Reviewed-by: Jungshik Shin <jshin@chromium.org>
Reviewed-by: Thanh Nguyen <thanhdng@chromium.org>
Reviewed-by: Richard Chui <richui@chromium.org>
Reviewed-by: Toni Barzic <tbarzic@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Auto-Submit: Frank Tang <ftang@chromium.org>
Reviewed-by: Kyle Horimoto <khorimoto@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1073687}
  • Loading branch information
FrankYFTang authored and Chromium LUCI CQ committed Nov 19, 2022
1 parent 9d8e443 commit 4e30468
Show file tree
Hide file tree
Showing 97 changed files with 206 additions and 121 deletions.
2 changes: 1 addition & 1 deletion DEPS
Original file line number Diff line number Diff line change
Expand Up @@ -1404,7 +1404,7 @@ deps = {
Var('chromium_git') + '/chromium/deps/hunspell_dictionaries.git' + '@' + '41cdffd71c9948f63c7ad36e1fb0ff519aa7a37e',

'src/third_party/icu':
Var('chromium_git') + '/chromium/deps/icu.git' + '@' + 'da07448619763d1cde255b361324242646f5b268',
Var('chromium_git') + '/chromium/deps/icu.git' + '@' + '1b7d391f0528fb3a4976b7541b387ee04f915f83',

'src/third_party/icu4j': {
'packages': [
Expand Down
2 changes: 1 addition & 1 deletion ash/glanceables/glanceables_unittests.cc
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ TEST_F(GlanceablesTest, UpNextEventItemViewRendersCorrectlyIn12HrClockFormat) {
GlanceablesUpNextEventItemView view(CreateTestEvent());

EXPECT_EQ(view.event_title_label_for_test()->GetText(), u"Test event 123");
EXPECT_EQ(view.event_time_label_for_test()->GetText(), u"6:00 PM");
EXPECT_EQ(view.event_time_label_for_test()->GetText(), u"6:00\u202fPM");
}

TEST_F(GlanceablesTest, UpNextEventItemViewRendersCorrectlyIn24HrClockFormat) {
Expand Down
6 changes: 3 additions & 3 deletions ash/login/ui/lock_contents_view_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2159,9 +2159,9 @@ TEST_F(LockContentsViewUnitTest, ShowReasonOnAuthDisabled) {
base::Hours(1), true /*disable_lock_screen_media*/));
EXPECT_FALSE(password_view->GetVisible());
EXPECT_FALSE(pin_view->GetVisible());
EXPECT_EQ(
l10n_util::GetStringFUTF16(IDS_ASH_LOGIN_COME_BACK_MESSAGE, u"8:00 AM"),
auth_test_api.GetDisabledAuthMessageContent());
EXPECT_EQ(l10n_util::GetStringFUTF16(IDS_ASH_LOGIN_COME_BACK_MESSAGE,
u"8:00\u202fAM"),
auth_test_api.GetDisabledAuthMessageContent());
// Setting auth disabled due to time usage limit.
DataDispatcher()->DisableAuthForUser(
kFirstUserAccountId,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,8 @@ TEST_F(AdaptiveChargingNotificationControllerTest, HaveTimeInNotification) {

// Current local time is 12:42 pm, so 5 hours after should be 5:30pm (rounding
// from 5:42pm).
EXPECT_NE(notification->message().find(u"5:30 pm"), std::u16string::npos);
EXPECT_NE(notification->message().find(u"5:30\u202fpm"),
std::u16string::npos);
}

TEST_F(AdaptiveChargingNotificationControllerTest, TimeRoundingUpTest) {
Expand Down Expand Up @@ -152,7 +153,8 @@ TEST_F(AdaptiveChargingNotificationControllerTest, TimeRoundingUpTest) {

// Current local time is 12:45 pm, so 5 hours after should be 6:00pm (rounding
// from 5:45pm).
EXPECT_NE(notification->message().find(u"6:00 pm"), std::u16string::npos);
EXPECT_NE(notification->message().find(u"6:00\u202fpm"),
std::u16string::npos);
}

TEST_F(AdaptiveChargingNotificationControllerTest,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,12 +112,13 @@ TEST_F(
const views::Label* summary_label = GetSummaryLabel();
const views::Label* time_label = GetTimeLabel();
EXPECT_EQ(u"summary_0", summary_label->GetText());
EXPECT_EQ(u"9:00 \x2013 10:00 AM", time_label->GetText());
EXPECT_EQ(u"summary_0, 9:00 \x2013 10:00 AM",
EXPECT_EQ(u"9:00\u2009\x2013\u200910:00\u202fAM", time_label->GetText());
EXPECT_EQ(u"summary_0, 9:00\u2009\x2013\u200910:00\u202fAM",
summary_label->GetTooltipText());
EXPECT_EQ(u"summary_0, 9:00 \x2013 10:00 AM", time_label->GetTooltipText());
EXPECT_EQ(u"summary_0, 9:00\u2009\x2013\u200910:00\u202fAM",
time_label->GetTooltipText());
EXPECT_EQ(
u"9:00 AM to\n 10:00 AM,\n GMT+02:00,\n "
u"9:00\u202fAM to\n 10:00\u202fAM,\n GMT+02:00,\n "
u"summary_0. Select for more details in Google Calendar.",
event_list_item_view()->GetAccessibleName());
}
Expand Down
12 changes: 6 additions & 6 deletions ash/system/time/calendar_event_list_view_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -217,12 +217,12 @@ TEST_F(CalendarViewEventListViewTest, CheckTimeFormat) {
CreateEventListView(date);

SetSelectedDate(date);
EXPECT_EQ(u"8:30 – 9:30 PM", GetTimeRange(0)->GetText());
EXPECT_EQ(u"11:30 – 11:59 PM", GetTimeRange(1)->GetText());
EXPECT_EQ(u"8:30\u2009\u20099:30\u202fPM", GetTimeRange(0)->GetText());
EXPECT_EQ(u"11:30\u2009\u200911:59\u202fPM", GetTimeRange(1)->GetText());

// Select the second day of the multi-day event.
SetSelectedDate(date_2);
EXPECT_EQ(u"12:00 – 12:30 AM", GetTimeRange(0)->GetText());
EXPECT_EQ(u"12:00\u2009\u200912:30\u202fAM", GetTimeRange(0)->GetText());

// Set the time in 24 hour format.
Shell::Get()->system_tray_model()->SetUse24HourClock(true);
Expand All @@ -231,11 +231,11 @@ TEST_F(CalendarViewEventListViewTest, CheckTimeFormat) {
CreateEventListView(date);

SetSelectedDate(date);
EXPECT_EQ(u"20:30 – 21:30", GetTimeRange(0)->GetText());
EXPECT_EQ(u"23:30 – 23:59", GetTimeRange(1)->GetText());
EXPECT_EQ(u"20:30\u2009\u200921:30", GetTimeRange(0)->GetText());
EXPECT_EQ(u"23:30\u2009\u200923:59", GetTimeRange(1)->GetText());

SetSelectedDate(date_2);
EXPECT_EQ(u"00:00 – 00:30", GetTimeRange(0)->GetText());
EXPECT_EQ(u"00:00\u2009\u200900:30", GetTimeRange(0)->GetText());
}

TEST_F(CalendarViewEventListViewTest, RefreshEvents) {
Expand Down
14 changes: 7 additions & 7 deletions ash/system/time/calendar_utils_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,9 @@ TEST_F(CalendarUtilsUnitTest, DateFormatterClockTimes) {
ASSERT_TRUE(base::Time::FromString("1 Aug 2021 00:00 GMT", &midnight));

// Return time in twelve hour clock format. (no '0' padding)
EXPECT_EQ(u"9:05 AM", calendar_utils::GetTwelveHourClockTime(am_time));
EXPECT_EQ(u"11:30 PM", calendar_utils::GetTwelveHourClockTime(pm_time));
EXPECT_EQ(u"12:00 AM", calendar_utils::GetTwelveHourClockTime(midnight));
EXPECT_EQ(u"9:05\u202fAM", calendar_utils::GetTwelveHourClockTime(am_time));
EXPECT_EQ(u"11:30\u202fPM", calendar_utils::GetTwelveHourClockTime(pm_time));
EXPECT_EQ(u"12:00\u202fAM", calendar_utils::GetTwelveHourClockTime(midnight));

// Return time in twenty four hour clock format. (has '0' padding)
EXPECT_EQ(u"09:05", calendar_utils::GetTwentyFourHourClockTime(am_time));
Expand Down Expand Up @@ -225,18 +225,18 @@ TEST_F(CalendarUtilsUnitTest, IntervalFormatter) {

ash::system::ScopedTimezoneSettings timezone_settings(u"GMT");

EXPECT_EQ(u"10:00 – 11:30 AM",
EXPECT_EQ(u"10:00\u2009\u200911:30\u202fAM",
calendar_utils::FormatTwelveHourClockTimeInterval(date1, date2));

EXPECT_EQ(u"10:00 AM – 3:49 PM",
EXPECT_EQ(u"10:00\u202fAM\u2009\u20093:49\u202fPM",
calendar_utils::FormatTwelveHourClockTimeInterval(date1, date3));

EXPECT_EQ(
u"10:00 – 11:30",
u"10:00\u2009\u200911:30",
calendar_utils::FormatTwentyFourHourClockTimeInterval(date1, date2));

EXPECT_EQ(
u"10:00 – 15:49",
u"10:00\u2009\u200915:49",
calendar_utils::FormatTwentyFourHourClockTimeInterval(date1, date3));
}

Expand Down
24 changes: 13 additions & 11 deletions ash/system/time/date_helper_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,13 @@ TEST_F(DateHelperUnittest, GetWeekTitle) {
SetDefaultLocale("zh-CN");
std::vector<std::u16string> week_titles =
DateHelper::GetInstance()->week_titles();
EXPECT_EQ(u"", week_titles[0]); // Sunday
EXPECT_EQ(u"", week_titles[1]); // Monday
EXPECT_EQ(u"", week_titles[2]); // Tuesday
EXPECT_EQ(u"", week_titles[3]); // Wednesday
EXPECT_EQ(u"", week_titles[4]); // Thursday
EXPECT_EQ(u"", week_titles[5]); // Friday
EXPECT_EQ(u"", week_titles[6]); // Saturday
EXPECT_EQ(u"", week_titles[0]); // Monday
EXPECT_EQ(u"", week_titles[1]); // Tuesday
EXPECT_EQ(u"", week_titles[2]); // Wednesday
EXPECT_EQ(u"", week_titles[3]); // Thursday
EXPECT_EQ(u"", week_titles[4]); // Friday
EXPECT_EQ(u"", week_titles[5]); // Saturday
EXPECT_EQ(u"", week_titles[6]); // Sunday

SetDefaultLocale("ar");
week_titles = DateHelper::GetInstance()->week_titles();
Expand Down Expand Up @@ -103,10 +103,12 @@ TEST_F(DateHelperUnittest, GetFormattedInterval) {
ASSERT_TRUE(base::Time::FromString("22 Nov 2021 22:30 GMT", &date3));

SetDefaultLocale("en_US");
EXPECT_EQ(u"10:00 – 11:45 AM", Format12HrClockInterval(date1, date2));
EXPECT_EQ(u"10:00 AM – 10:30 PM", Format12HrClockInterval(date1, date3));
EXPECT_EQ(u"10:00 – 11:45", Format24HrClockInterval(date1, date2));
EXPECT_EQ(u"10:00 – 22:30", Format24HrClockInterval(date1, date3));
EXPECT_EQ(u"10:00\u2009\u200911:45\u202fAM",
Format12HrClockInterval(date1, date2));
EXPECT_EQ(u"10:00\u202fAM\u2009\u200910:30\u202fPM",
Format12HrClockInterval(date1, date3));
EXPECT_EQ(u"10:00\u2009\u200911:45", Format24HrClockInterval(date1, date2));
EXPECT_EQ(u"10:00\u2009\u200922:30", Format24HrClockInterval(date1, date3));

SetDefaultLocale("zh_Hant");
EXPECT_EQ(u"上午10:00至11:45", Format12HrClockInterval(date1, date2));
Expand Down
20 changes: 10 additions & 10 deletions ash/system/time/event_date_formatter_util_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ TEST_F(EventDateFormatterUtilTest,
event_date_formatter_util::GetStartAndEndTimeAccessibleNames(start_time,
end_time);

EXPECT_EQ(actual_start, u"3:30 PM");
EXPECT_EQ(actual_end, u"4:30 PM");
EXPECT_EQ(actual_start, u"3:30\u202fPM");
EXPECT_EQ(actual_end, u"4:30\u202fPM");
}

TEST_F(EventDateFormatterUtilTest, GetFormattedInterval_12HourClock) {
Expand All @@ -81,7 +81,7 @@ TEST_F(EventDateFormatterUtilTest, GetFormattedInterval_12HourClock) {
event_date_formatter_util::GetFormattedInterval(start_time, end_time);

// \x2013 is unicode for dash i.e. '-'
EXPECT_EQ(actual, u"3:30 \x2013 4:30 PM");
EXPECT_EQ(actual, u"3:30\u2009\x2013\u20094:30\u202fPM");
}

TEST_F(EventDateFormatterUtilTest, GetFormattedInterval_24HourClock) {
Expand All @@ -98,7 +98,7 @@ TEST_F(EventDateFormatterUtilTest, GetFormattedInterval_24HourClock) {
event_date_formatter_util::GetFormattedInterval(start_time, end_time);

// \x2013 is unicode for dash i.e. '-'
EXPECT_EQ(actual, u"15:30 \x2013 16:30");
EXPECT_EQ(actual, u"15:30\u2009\x2013\u200916:30");
}

class EventDateFormatterAllDayEventTest
Expand Down Expand Up @@ -171,28 +171,28 @@ INSTANTIATE_TEST_SUITE_P(
testing::Values(
MultiDayEventTestParams{
"22 Nov 2021 09:00 GMT", "24 Nov 2021 09:00 GMT",
"22 Nov 2021 00:00 UTC", u"Starts at 10:00 AM (Day 1/3)"},
"22 Nov 2021 00:00 UTC", u"Starts at 10:00\u202fAM (Day 1/3)"},
MultiDayEventTestParams{
"22 Nov 2021 09:00 GMT", "24 Nov 2021 09:00 GMT",
"23 Nov 2021 00:00 UTC", u"Starts at 10:00 AM (Day 2/3)"},
"23 Nov 2021 00:00 UTC", u"Starts at 10:00\u202fAM (Day 2/3)"},
MultiDayEventTestParams{
"22 Nov 2021 09:00 GMT", "24 Nov 2021 09:00 GMT",
"24 Nov 2021 00:00 UTC", u"Ends at 10:00 AM (Day 3/3)"},
"24 Nov 2021 00:00 UTC", u"Ends at 10:00\u202fAM (Day 3/3)"},
// Test edge case where a multi-day event falls into a single day in the
// right timezone.
MultiDayEventTestParams{
"22 Nov 2021 23:00 GMT", "23 Nov 2021 23:00 GMT",
"23 Nov 2021 00:00 UTC", u"Starts at 12:00 AM (Day 1/1)"},
"23 Nov 2021 00:00 UTC", u"Starts at 12:00\u202fAM (Day 1/1)"},
// Test where a 2 hour event spans multiple days depending on timezone,
// day 1.
MultiDayEventTestParams{
"22 Nov 2021 22:00 GMT", "23 Nov 2021 00:00 GMT",
"22 Nov 2021 00:00 UTC", u"Starts at 11:00 PM (Day 1/2)"},
"22 Nov 2021 00:00 UTC", u"Starts at 11:00\u202fPM (Day 1/2)"},
// Test where a 2 hour event spans multiple days depending on timezone,
// day 2.
MultiDayEventTestParams{
"22 Nov 2021 22:00 GMT", "23 Nov 2021 00:00 GMT",
"23 Nov 2021 00:00 UTC", u"Ends at 1:00 AM (Day 2/2)"}));
"23 Nov 2021 00:00 UTC", u"Ends at 1:00\u202fAM (Day 2/2)"}));

TEST_P(EventDateFormatterMultiDayEventTest, GetMultiDayText_MultiDayEvent) {
const char* start_time_string = GetStartTimeString();
Expand Down
17 changes: 13 additions & 4 deletions ash/system/time/time_of_day_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,26 @@ TEST(TimeOfDayTest, TestSeveralOffsets) {

// 6:32 PM ==> 18:32.
TimeOfDay time1(18 * 60 + 32);
EXPECT_EQ("6:32 PM", time1.ToString());
EXPECT_EQ("6:32\xE2\x80\xAFPM", time1.ToString());

// 9:59 AM.
TimeOfDay time2(9 * 60 + 59);
EXPECT_EQ("9:59 AM", time2.ToString());
EXPECT_EQ(
"9:59\xE2\x80\xAF"
"AM",
time2.ToString());

// Border times: 00:00 and 24:00.
TimeOfDay time3(0);
TimeOfDay time4(24 * 60);
EXPECT_EQ("12:00 AM", time3.ToString());
EXPECT_EQ("12:00 AM", time4.ToString());
EXPECT_EQ(
"12:00\xE2\x80\xAF"
"AM",
time3.ToString());
EXPECT_EQ(
"12:00\xE2\x80\xAF"
"AM",
time4.ToString());
}

TEST(TimeOfDayTest, TestFromTime) {
Expand Down
9 changes: 6 additions & 3 deletions ash/wm/desks/templates/saved_desk_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3438,9 +3438,12 @@ TEST_F(SavedDeskTest, TimeStrFormat) {
};
// The expected time string for each template.
const std::vector<std::u16string> expected_timestr = {
u"Jan 1, 2022, 10:30 AM",
u"Today 10:30 AM",
u"Yesterday 10:30 AM",
u"Jan 1, 2022, 10:30\u202f"
"AM",
u"Today 10:30\u202f"
"AM",
u"Yesterday 10:30\u202f"
"AM",
};
std::vector<base::Time> time = {
time_long_ago,
Expand Down
20 changes: 10 additions & 10 deletions base/i18n/time_formatting_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ TEST(TimeFormattingTest, TimeFormatTimeOfDayDefault12h) {
Time time;
EXPECT_TRUE(Time::FromUTCExploded(kTestDateTimeExploded, &time));
std::u16string clock24h(u"15:42");
std::u16string clock12h_pm(u"3:42 PM");
std::u16string clock12h_pm(u"3:42\u202fPM");
std::u16string clock12h(u"3:42");
std::u16string clock24h_millis(u"15:42:07.000");

Expand Down Expand Up @@ -114,7 +114,7 @@ TEST(TimeFormattingTest, TimeFormatTimeOfDayDefault24h) {
Time time;
EXPECT_TRUE(Time::FromUTCExploded(kTestDateTimeExploded, &time));
std::u16string clock24h(u"15:42");
std::u16string clock12h_pm(u"3:42 pm");
std::u16string clock12h_pm(u"3:42\u202fpm");
std::u16string clock12h(u"3:42");
std::u16string clock24h_millis(u"15:42:07.000");

Expand Down Expand Up @@ -179,7 +179,7 @@ TEST(TimeFormattingTest, TimeFormatTimeOfDayDE) {
Time time;
EXPECT_TRUE(Time::FromUTCExploded(kTestDateTimeExploded, &time));
std::u16string clock24h(u"15:42");
std::u16string clock12h_pm(u"3:42 PM");
std::u16string clock12h_pm(u"3:42\u202fPM");
std::u16string clock12h(u"3:42");

// The default is 24h clock.
Expand Down Expand Up @@ -244,13 +244,13 @@ TEST(TimeFormattingTest, TimeFormatDateUS) {
EXPECT_EQ(u"Apr 30, 2011", TimeFormatShortDate(time));
EXPECT_EQ(u"4/30/11", TimeFormatShortDateNumeric(time));

EXPECT_EQ(u"4/30/11, 3:42:07 PM", TimeFormatShortDateAndTime(time));
EXPECT_EQ(u"4/30/11, 3:42:07 PM " + GetShortTimeZone(time),
EXPECT_EQ(u"4/30/11, 3:42:07\u202fPM", TimeFormatShortDateAndTime(time));
EXPECT_EQ(u"4/30/11, 3:42:07\u202fPM " + GetShortTimeZone(time),
TimeFormatShortDateAndTimeWithTimeZone(time));

EXPECT_EQ(u"April 2011", TimeFormatMonthAndYear(time));

EXPECT_EQ(u"Saturday, April 30, 2011 at 3:42:07 PM",
EXPECT_EQ(u"Saturday, April 30, 2011 at 3:42:07\u202fPM",
TimeFormatFriendlyDateAndTime(time));

EXPECT_EQ(u"Saturday, April 30, 2011", TimeFormatFriendlyDate(time));
Expand Down Expand Up @@ -286,7 +286,7 @@ TEST(TimeFormattingTest, TimeFormatWithPattern) {

i18n::SetICUDefaultLocale("en_US");
EXPECT_EQ(u"Apr 30, 2011", TimeFormatWithPattern(time, "yMMMd"));
EXPECT_EQ(u"April 30 at 3:42:07 PM",
EXPECT_EQ(u"April 30 at 3:42:07\u202fPM",
TimeFormatWithPattern(time, "MMMMdjmmss"));

i18n::SetICUDefaultLocale("en_GB");
Expand Down Expand Up @@ -405,7 +405,7 @@ TEST(TimeFormattingTest, TimeIntervalFormat) {
EXPECT_TRUE(Time::FromUTCExploded(kTestIntervalEndTimeExploded, &end_time));

EXPECT_EQ(
u"Saturday, April 30 – Saturday, May 28",
u"Saturday, April 30\u2009\u2009Saturday, May 28",
DateIntervalFormat(begin_time, end_time, DATE_FORMAT_MONTH_WEEKDAY_DAY));

const Time::Exploded kTestIntervalBeginTimeExploded = {
Expand All @@ -415,12 +415,12 @@ TEST(TimeFormattingTest, TimeIntervalFormat) {
EXPECT_TRUE(
Time::FromUTCExploded(kTestIntervalBeginTimeExploded, &begin_time));
EXPECT_EQ(
u"Monday, May 16 – Saturday, May 28",
u"Monday, May 16\u2009\u2009Saturday, May 28",
DateIntervalFormat(begin_time, end_time, DATE_FORMAT_MONTH_WEEKDAY_DAY));

i18n::SetICUDefaultLocale("en_GB");
EXPECT_EQ(
u"Monday 16 May – Saturday 28 May",
u"Monday 16\u2009\u2009Saturday 28 May",
DateIntervalFormat(begin_time, end_time, DATE_FORMAT_MONTH_WEEKDAY_DAY));

i18n::SetICUDefaultLocale("ja");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,9 @@ function getMaxDate() {
* @return {Date} The converted time.
*/
function getDateInTimezone(timezoneId) {
return new Date(new Date().toLocaleString('en-US', {timeZone: timezoneId}));
return new Date(new Date()
.toLocaleString('en-US', {timeZone: timezoneId})
.replace('\u202f', ' '));
}

/**
Expand Down

0 comments on commit 4e30468

Please sign in to comment.