MCPcopy Create free account
hub / github.com/breck7/scroll / timeWeekday

Function timeWeekday

external/.d3.js:15823–15832  ·  view source on GitHub ↗
(i)

Source from the content-addressed store, hash-verified

15821const unixDays = unixDay.range;
15822
15823function timeWeekday(i) {
15824 return timeInterval((date) => {
15825 date.setDate(date.getDate() - (date.getDay() + 7 - i) % 7);
15826 date.setHours(0, 0, 0, 0);
15827 }, (date, step) => {
15828 date.setDate(date.getDate() + step * 7);
15829 }, (start, end) => {
15830 return (end - start - (end.getTimezoneOffset() - start.getTimezoneOffset()) * durationMinute) / durationWeek;
15831 });
15832}
15833
15834const timeSunday = timeWeekday(0);
15835const timeMonday = timeWeekday(1);

Callers 1

.d3.jsFile · 0.85

Calls 1

timeIntervalFunction · 0.85

Tested by

no test coverage detected