mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-12-28 14:43:52 +03:00
Standardize UTC timezone for `translateMonth` and `translateDay` tests.
This commit is contained in:
parent
371dd96e3e
commit
1d52228ee7
1 changed files with 2 additions and 2 deletions
|
@ -78,12 +78,12 @@ function getCurrentLocale() {
|
||||||
|
|
||||||
// given a month (0-11), returns it in the documents language
|
// given a month (0-11), returns it in the documents language
|
||||||
export function translateMonth(month) {
|
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
|
// given a weekday (0-6, Sunday to Saturday), returns it in the documents language
|
||||||
export function translateDay(day) {
|
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
|
// convert a Blob to a DataURI
|
||||||
|
|
Loading…
Reference in a new issue