visiting-hours
Version:
An advanced, feature rich, optimised and tiny visiting-hours library.
20 lines (19 loc) • 638 B
TypeScript
export declare class Timezone {
static formattersCache: {
[key: string]: Intl.DateTimeFormat;
};
static getDateTimeFormat(timeZone: string): Intl.DateTimeFormat;
static partsOffset(dtf: Intl.DateTimeFormat, date: Date): Formatted;
static utcToZonedTime(date: Date, timeZone: string): Date;
static fromTimeValues(hours: number, minutes: number, zone?: string, now?: Date): Date;
static fromTimeString(time: string, zone: string, now?: Date): Date;
}
declare type Formatted = {
year: number;
month: number;
day: number;
hour: number;
minute: number;
second: number;
};
export {};