linkgetLocaleDateFormat
| npm Package | @angular/common |
|---|---|
| Module | import { getLocaleDateFormat } from '@angular/common'; |
| Source | common/src/i18n/locale_data_api.ts |
function getLocaleDateFormat(locale: string, width: FormatWidth): string;
linkDescription
Date format that depends on the locale.
There are four basic date formats:
-
fullshould contain long-weekday (EEEE), year (y), long-month (MMMM), day (d).For example, English uses
EEEE, MMMM d, y, corresponding to a date like "Tuesday, September 14, 1999". -
longshould contain year, long-month, day.For example,
MMMM d, y, corresponding to a date like "September 14, 1999". -
mediumshould contain year, abbreviated-month (MMM), day.For example,
MMM d, y, corresponding to a date like "Sep 14, 1999". For languages that do not use abbreviated months, use the numeric month (MM/M). For example,y/MM/dd, corresponding to a date like "1999/09/14". -
shortshould contain year, numeric-month (MM/M), and day.For example,
M/d/yy, corresponding to a date like "9/14/99".