MCPcopy Create free account
hub / github.com/Effect-TS/effect / nextDay

Function nextDay

packages/effect/src/internal/schedule.ts:1800–1807  ·  view source on GitHub ↗
(now: number, dayOfWeek: number, initial: boolean)

Source from the content-addressed store, hash-verified

1798
1799/** @internal */
1800export const nextDay = (now: number, dayOfWeek: number, initial: boolean): number => {
1801 const date = new Date(now)
1802 if (date.getDay() === dayOfWeek && initial) {
1803 return now
1804 }
1805 const nextDayOfWeek = (7 + dayOfWeek - date.getDay()) % 7
1806 return date.setDate(date.getDate() + (nextDayOfWeek === 0 ? 7 : nextDayOfWeek))
1807}
1808
1809/** @internal */
1810export const nextDayOfMonth = (now: number, day: number, initial: boolean): number => {

Callers 1

dayOfWeekFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…