(baseParts: DatetimeParts, compareParts: DatetimeParts)
| 15 | * Returns true is the selected day is before the reference day. |
| 16 | */ |
| 17 | export const isBefore = (baseParts: DatetimeParts, compareParts: DatetimeParts) => { |
| 18 | return !!( |
| 19 | baseParts.year < compareParts.year || |
| 20 | (baseParts.year === compareParts.year && baseParts.month < compareParts.month) || |
| 21 | (baseParts.year === compareParts.year && |
| 22 | baseParts.month === compareParts.month && |
| 23 | baseParts.day !== null && |
| 24 | baseParts.day < compareParts.day!) |
| 25 | ); |
| 26 | }; |
| 27 | |
| 28 | /** |
| 29 | * Returns true is the selected day is after the reference day. |
no outgoing calls
no test coverage detected