time
Utilities for manipulating time strings, e.g. 1:44.23.
// access like this (preferred)
import {formatTimeMs, parseTime} from "@liqvid/utils/time";
// or like this (legacy)
import {Utils} from "liqvid";
const {formatTimeMs, parseTime} = Utils.time;
formatTime()
Format a time (given in milliseconds) as hh:mm:ss.
formatTime(time: number): string;
formatTimeMs()
Format a time (given in milliseconds) as hh:mm:ss.ms.
formatTimeMs(time: number): string;
parseTime()
Parses a time in hh:mm:ss.ms format to milliseconds. Hours, minutes, and milliseconds can be omitted if 0.
parseTime(str: string): number;
timeRegexp
The regular expression used internally by parseTime(). Equal to /^(?:(?:(\d+):)?(\d+):)?(\d+)(?:\.(\d+))?$/.
timeRegexp: RegExp;