Have time.js use UTC-related getters/setters when working with `Date`

This commit is contained in:
Sam Fisher 2024-05-03 20:24:00 -07:00
parent 0f3e717a1a
commit 44ad644df8
1 changed files with 2 additions and 2 deletions

View File

@ -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);