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

Function findNextMonth

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

Source from the content-addressed store, hash-verified

1828
1829/** @internal */
1830export const findNextMonth = (now: number, day: number, months: number): number => {
1831 const d = new Date(now)
1832 const tmp1 = new Date(d.setDate(day))
1833 const tmp2 = new Date(tmp1.setMonth(tmp1.getMonth() + months))
1834 if (tmp2.getDate() === day) {
1835 const d2 = new Date(now)
1836 const tmp3 = new Date(d2.setDate(day))
1837 return tmp3.setMonth(tmp3.getMonth() + months)
1838 }
1839 return findNextMonth(now, day, months + 1)
1840}
1841
1842// circular with Effect
1843

Callers 1

nextDayOfMonthFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected