datezone
Version:
A lightweight and comprehensive date and timeZone utility library for JavaScript.
17 lines • 739 B
TypeScript
export declare const FULL_TS: {
readonly day: "2-digit";
readonly hour: "2-digit";
readonly hour12: false;
readonly millisecond: "3-digit";
readonly minute: "2-digit";
readonly month: "2-digit";
readonly second: "2-digit";
readonly year: "numeric";
};
type DatePartType = "year" | "month" | "day" | "hour" | "minute" | "second" | "weekday" | "era" | "timeZoneName" | "millisecond";
type ExtractDatePartKeys<T> = Extract<keyof T, DatePartType>;
export declare function formatToParts<T extends Partial<Record<DatePartType, string>> & Intl.DateTimeFormatOptions>(date: number, timeZone: string, opts: T): {
[K in ExtractDatePartKeys<T>]: number;
};
export {};
//# sourceMappingURL=format-parts.pub.d.ts.map