extract-time ⏰
Extracts time from an arbitrary text input.
Features
- Deterministic and unambiguous time parsing.
Usage
; ;// [{time: '14:00'}] ;// [{time: '16:00'}, {time: '18:00'}] ;// [{time: '13:30'}] ;// [{time: '13:30'}] ;// [{time: '13:30'}]
Signature
/** * Indicates if time format is 12-hour or 24-hour clock notation. */; /** * @property time 24-hour military time. */type TimeMatchType = | +time: string|; /** * @param subject Arbitrary text input. */type extractTime = subject: string timeNotation: TimeNotationType $ReadOnlyArray<TimeMatchType>;
Related projects
extract-date
– Extracts date from an arbitrary text input.extract-price
– Extracts price from an arbitrary text input.