(day: number)
| 524 | |
| 525 | /** @internal */ |
| 526 | export const dayOfMonth = (day: number): Schedule.Schedule<number> => { |
| 527 | return makeWithState<[number, number], unknown, number>( |
| 528 | [Number.NEGATIVE_INFINITY, 0], |
| 529 | (now, _, state) => { |
| 530 | if (!Number.isInteger(day) || day < 1 || 31 < day) { |
| 531 | return core.dieSync(() => |
| 532 | new core.IllegalArgumentException( |
| 533 | `Invalid argument in: dayOfMonth(${day}). Must be in range 1...31` |
| 534 | ) |
| 535 | ) |
| 536 | } |
| 537 | const n = state[1] |
| 538 | const initial = n === 0 |
| 539 | const day0 = nextDayOfMonth(now, day, initial) |
| 540 | const start = beginningOfDay(day0) |
| 541 | const end = endOfDay(day0) |
| 542 | const interval = Interval.make(start, end) |
| 543 | return core.succeed( |
| 544 | [ |
| 545 | [end, n + 1], |
| 546 | n, |
| 547 | ScheduleDecision.continueWith(interval) |
| 548 | ] |
| 549 | ) |
| 550 | } |
| 551 | ) |
| 552 | } |
| 553 | |
| 554 | /** @internal */ |
| 555 | export const dayOfWeek = (day: number): Schedule.Schedule<number> => { |
nothing calls this directly
no test coverage detected