1.3 kBTypeScriptView Raw
1/** describes a component of time. `H:MM:SS.MS` */
2export declare enum TimeUnit {
3 HOUR_24 = "hour24",
4 HOUR_12 = "hour12",
5 MINUTE = "minute",
6 SECOND = "second",
7 MS = "ms"
9/** Gets a descriptive label representing the plural of the given time unit. */
10export declare function getTimeUnitPrintStr(unit: TimeUnit): string;
11/** Returns the given time unit component of the date. */
12export declare function getTimeUnit(unit: TimeUnit, date: Date): number;
13/** Sets the given time unit to the given time in date object. Modifies given `date` object and returns it. */
14export declare function setTimeUnit(unit: TimeUnit, time: number, date: Date, isPm: boolean): Date;
15/** Returns true if `time` is a valid value */
16export declare function isTimeUnitValid(unit: TimeUnit, time?: number): boolean;
17/** If unit of time is greater than max, returns min. If less than min, returns max. Otherwise, returns time. */
18export declare function wrapTimeAtUnit(unit: TimeUnit, time: number): number;
19export declare function getTimeUnitClassName(unit: TimeUnit): string;
20export declare function getTimeUnitMax(unit: TimeUnit): number;
21export declare function getTimeUnitMin(unit: TimeUnit): number;
22export declare function getDefaultMinTime(): Date;
23export declare function getDefaultMaxTime(): Date;