(now: number, day: number, months: number)
| 1828 | |
| 1829 | /** @internal */ |
| 1830 | export 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 |