From 44ad644df8569dd87c749f042c50e189a2c81f3e Mon Sep 17 00:00:00 2001 From: Sam Fisher Date: Fri, 3 May 2024 20:24:00 -0700 Subject: [PATCH] Have time.js use UTC-related getters/setters when working with `Date` --- web_src/js/utils/time.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/web_src/js/utils/time.js b/web_src/js/utils/time.js index 1848792c98..246ee4a2af 100644 --- a/web_src/js/utils/time.js +++ b/web_src/js/utils/time.js @@ -4,8 +4,8 @@ import {getCurrentLocale} from '../utils.js'; // Returns an array of millisecond-timestamps of start-of-week days (Sundays) export function startDaysBetween(startDate, endDate) { // Ensure the start date is a Sunday - while (startDate.getDay() !== 0) { - startDate.setDate(startDate.getDate() + 1); + while (startDate.getUTCDay() !== 0) { + startDate.setUTCDate(startDate.getUTCDate() + 1); } const start = dayjs(startDate);