Skip to content

Commit 44ad644

Browse files
author
Sam Fisher
committed
Have time.js use UTC-related getters/setters when working with Date
1 parent 0f3e717 commit 44ad644

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

web_src/js/utils/time.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ import {getCurrentLocale} from '../utils.js';
44
// Returns an array of millisecond-timestamps of start-of-week days (Sundays)
55
export function startDaysBetween(startDate, endDate) {
66
// Ensure the start date is a Sunday
7-
while (startDate.getDay() !== 0) {
8-
startDate.setDate(startDate.getDate() + 1);
7+
while (startDate.getUTCDay() !== 0) {
8+
startDate.setUTCDate(startDate.getUTCDate() + 1);
99
}
1010

1111
const start = dayjs(startDate);

0 commit comments

Comments
 (0)