summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFelipe Leopoldo Sologuren GutiƩrrez <fsologureng@users.noreply.github.com>2022-11-22 05:46:29 -0300
committerGitHub <noreply@github.com>2022-11-22 16:46:29 +0800
commit1d52228ee7b41546aa4e2d0034f2ae337deaae25 (patch)
tree754a8079d7760b88b485e80b46df742a550b13a3
parent371dd96e3ec9223dcf8401578afbada07fbabf27 (diff)
downloadgitea-1d52228ee7b41546aa4e2d0034f2ae337deaae25.tar.gz
gitea-1d52228ee7b41546aa4e2d0034f2ae337deaae25.zip
Fixes #21895: standardize UTC tz for util tests (#21897)
Standardize UTC timezone for `translateMonth` and `translateDay` tests.
-rw-r--r--web_src/js/utils.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/web_src/js/utils.js b/web_src/js/utils.js
index 62ee11c2eb..01c076aeba 100644
--- a/web_src/js/utils.js
+++ b/web_src/js/utils.js
@@ -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