uc-base-libraries
Version:
Typescript libraries for UC projects
28 lines (27 loc) • 933 B
TypeScript
import * as EventHandler from './EventHandler';
declare global {
interface Date {
formatDate: () => string;
formatTime: (hideMs?: boolean) => string;
addDays(days: number): Date;
}
}
export declare class ServerTime {
timeApiUrl: string;
serverStartTime: Date;
startTime: Date;
serverDateTime: Date;
offset: number;
serverTimeLoaded: boolean;
raiseMessageEvent: EventHandler.EventHandler<string>;
constructor(timeApiUrl: string);
init: () => Promise<void>;
now: () => Date;
refreshServerTime: () => Promise<void>;
}
export declare const serverTime: ServerTime;
export declare function dateFromIso8601(isostr: string): Date;
export declare function formatTimeSpan(ts: number): string;
export declare function formatDate(dt: Date): string;
export declare function formatTime(dt: Date, hideMs?: boolean): string;
export declare function getTimeCount(): number;