Browse Source

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

pull/30857/head
Sam Fisher 1 month ago
parent
commit
44ad644df8
1 changed files with 2 additions and 2 deletions
  1. 2
    2
      web_src/js/utils/time.js

+ 2
- 2
web_src/js/utils/time.js 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);

Loading…
Cancel
Save