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