MCPcopy Create free account
hub / github.com/glideapps/quicktype / isTime

Function isTime

src/DateTime.ts:43–52  ·  view source on GitHub ↗
(str: string, full: boolean)

Source from the content-addressed store, hash-verified

41}
42
43export function isTime(str: string, full: boolean): boolean {
44 const matches = str.match(TIME);
45 if (!matches) return false;
46
47 const hour = +matches[1];
48 const minute = +matches[2];
49 const second = +matches[3];
50 const timeZone = matches[5];
51 return hour <= 23 && minute <= 59 && second <= 59 && (!full || !!timeZone);
52}
53
54const DATE_TIME_SEPARATOR = /t|\s/i;
55export function isDateTime(str: string): boolean {

Callers 3

CompressedJSONClass · 0.90
canBeEnumCaseFunction · 0.90
isDateTimeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…