Skip to content

Commit

Permalink
Fixes go-gitea#21895: standardize UTC tz for translateMonth and `tr…
Browse files Browse the repository at this point in the history
…anslateDay` tests
  • Loading branch information
fsologureng committed Nov 22, 2022
1 parent 371dd96 commit 27cf762
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 27cf762

Please sign in to comment.