Skip to content

Commit

Permalink
Have firstStartDateAfterDate() use UTC-related methods
Browse files Browse the repository at this point in the history
  • Loading branch information
kemzeb committed May 4, 2024
1 parent 44ad644 commit 4c6b196
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions web_src/js/utils/time.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ export function firstStartDateAfterDate(inputDate) {
if (!(inputDate instanceof Date)) {
throw new Error('Invalid date');
}
const dayOfWeek = inputDate.getDay();
const dayOfWeek = inputDate.getUTCDay();
const daysUntilSunday = 7 - dayOfWeek;
const resultDate = new Date(inputDate.getTime());
resultDate.setDate(resultDate.getDate() + daysUntilSunday);
resultDate.setUTCDate(resultDate.getUTCDate() + daysUntilSunday);
return resultDate.valueOf();
}

Expand Down

0 comments on commit 4c6b196

Please sign in to comment.