Skip to content

Commit

Permalink
Fixes go-gitea#21895: standardize UTC tz for util tests (go-gitea#21897)
Browse files Browse the repository at this point in the history
Standardize UTC timezone for `translateMonth` and `translateDay` tests.
  • Loading branch information
fsologureng committed Nov 22, 2022
1 parent 05b73aa commit 4a5afa1
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 4a5afa1

Please sign in to comment.