date-time-format-icu
Version:
This package provides a simple and flexible way to format JavaScript dates
19 lines (16 loc) • 571 B
TypeScript
declare enum DateFormat {
short = "M/d/yy, h:mm a",
medium = "MMM d, y, h:mm:ss a",
long = "MMMM d, y, h:mm:ss a z",
full = "EEEE, MMMM d, y, h:mm:ss a zzzz",
shortDate = "M/d/yy",
mediumDate = "MMM d, y",
longDate = "MMMM d, y",
fullDate = "EEEE, MMMM d, y",
shortTime = "h:mm a",
mediumTime = "h:mm:ss a",
longTime = "h:mm:ss a z",
fullTime = "h:mm:ss a zzzz"
}
declare function dateFormatter(input: Date | string | number, format?: keyof typeof DateFormat | string, locale?: string): string;
export { dateFormatter };