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

Function findNextMonth

packages/effect/src/internal/schedule.ts:1822–1832  ·  view source on GitHub ↗
(now: number, day: number, months: number)

Source from the content-addressed store, hash-verified

1820
1821/** @internal */
1822export const findNextMonth = (now: number, day: number, months: number): number => {
1823 const d = new Date(now)
1824 const tmp1 = new Date(d.setDate(day))
1825 const tmp2 = new Date(tmp1.setMonth(tmp1.getMonth() + months))
1826 if (tmp2.getDate() === day) {
1827 const d2 = new Date(now)
1828 const tmp3 = new Date(d2.setDate(day))
1829 return tmp3.setMonth(tmp3.getMonth() + months)
1830 }
1831 return findNextMonth(now, day, months + 1)
1832}
1833
1834// circular with Effect
1835

Callers 1

nextDayOfMonthFunction · 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…