MCPcopy Create free account
hub / github.com/chainjet/platform / parseTime

Function parseTime

libs/common/src/utils/date.utils.ts:7–13  ·  view source on GitHub ↗
(time: string)

Source from the content-addressed store, hash-verified

5}
6
7export 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

Callers 2

getTriggerNextCheckMethod · 0.90
date.utils.spec.tsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected