This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const MS_IN_WEEK = 1000 * 3600 * 24 * 7; | |
const MS_IN_DAY = 1000 * 3600 * 24; | |
function setDay(date, day) { | |
return new Date(date.getTime() + (day - date.getDay() * MS_IN_DAY)); | |
} | |
function getWeekDayOccurrences(dateRange, dayId) { | |
const [dayStart, dayEnd] = dateRange; |
OlderNewer