Skip to content

Commit

Permalink
Fixes #21895: standardize UTC tz for util tests (#21897)
Browse files Browse the repository at this point in the history
Standardize UTC timezone for `translateMonth` and `translateDay` tests.
  • Loading branch information
fsologureng authored Nov 22, 2022
1 parent 371dd96 commit 1d52228
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions web_src/js/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,12 @@ function getCurrentLocale() {

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

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

// convert a Blob to a DataURI
Expand Down

0 comments on commit 1d52228

Please sign in to comment.