From 1d52228ee7b41546aa4e2d0034f2ae337deaae25 Mon Sep 17 00:00:00 2001 From: Felipe Leopoldo Sologuren GutiƩrrez Date: Tue, 22 Nov 2022 05:46:29 -0300 Subject: Fixes #21895: standardize UTC tz for util tests (#21897) Standardize UTC timezone for `translateMonth` and `translateDay` tests. --- web_src/js/utils.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'web_src') 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 -- cgit v1.2.3