(time: string)
| 5 | } |
| 6 | |
| 7 | export function parseTime(time: string): [number, number] { |
| 8 | const [hours, minutes] = time.split(':').map((x) => Number(x)) |
| 9 | if (Number.isNaN(hours) || Number.isNaN(minutes) || hours > 23 || minutes > 59) { |
| 10 | throw new BadRequestException('Time is not valid') |
| 11 | } |
| 12 | return [hours, minutes] |
| 13 | } |
| 14 | |
| 15 | /** |
| 16 | * Returns the date in exactly one month from now or a given start date |
no outgoing calls
no test coverage detected