Skip to content

Commit 1d52228

Browse files
authored
Fixes #21895: standardize UTC tz for util tests (#21897)
Standardize UTC timezone for `translateMonth` and `translateDay` tests.
1 parent 371dd96 commit 1d52228

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

web_src/js/utils.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -78,12 +78,12 @@ function getCurrentLocale() {
7878

7979
// given a month (0-11), returns it in the documents language
8080
export function translateMonth(month) {
81-
return new Date(Date.UTC(2022, month, 12)).toLocaleString(getCurrentLocale(), {month: 'short'});
81+
return new Date(Date.UTC(2022, month, 12)).toLocaleString(getCurrentLocale(), {month: 'short', timeZone: 'UTC'});
8282
}
8383

8484
// given a weekday (0-6, Sunday to Saturday), returns it in the documents language
8585
export function translateDay(day) {
86-
return new Date(Date.UTC(2022, 7, day)).toLocaleString(getCurrentLocale(), {weekday: 'short'});
86+
return new Date(Date.UTC(2022, 7, day)).toLocaleString(getCurrentLocale(), {weekday: 'short', timeZone: 'UTC'});
8787
}
8888

8989
// convert a Blob to a DataURI

0 commit comments

Comments
 (0)