This is the archived documentation for Angular v6. Please visit angular.io to see documentation for the current version of Angular.

getLocaleDateFormat

Date format that depends on the locale.

See more...

getLocaleDateFormat(locale: string, width: FormatWidth): string
      
      getLocaleDateFormat(locale: string, width: FormatWidth): string
    

Parameters

locale

Type: string.

width

Type: FormatWidth.

Returns

string

Description

There are four basic date formats:

  • full should 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".

  • long should contain year, long-month, day.

    For example, MMMM d, y, corresponding to a date like "September 14, 1999".

  • medium should 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".

  • short should contain year, numeric-month (MM/M), and day.

    For example, M/d/yy, corresponding to a date like "9/14/99".