Browse Source

Fixes #21895: standardize UTC tz for util tests (#21897)

Standardize UTC timezone for `translateMonth` and `translateDay` tests.
tags/v1.19.0-rc0
Felipe Leopoldo Sologuren Gutiérrez 1 year ago
parent
commit
1d52228ee7
No account linked to committer's email address
1 changed files with 2 additions and 2 deletions
  1. 2
    2
      web_src/js/utils.js

+ 2
- 2
web_src/js/utils.js View File

@@ -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

Loading…
Cancel
Save