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

Function nextDayOfMonth

packages/effect/src/internal/schedule.ts:1818–1827  ·  view source on GitHub ↗
(now: number, day: number, initial: boolean)

Source from the content-addressed store, hash-verified

1816
1817/** @internal */
1818export const nextDayOfMonth = (now: number, day: number, initial: boolean): number => {
1819 const date = new Date(now)
1820 if (date.getDate() === day && initial) {
1821 return now
1822 }
1823 if (date.getDate() < day) {
1824 return date.setDate(day)
1825 }
1826 return findNextMonth(now, day, 1)
1827}
1828
1829/** @internal */
1830export const findNextMonth = (now: number, day: number, months: number): number => {

Callers 1

dayOfMonthFunction · 0.85

Calls 1

findNextMonthFunction · 0.85

Tested by

no test coverage detected