getLocaleDateFormat

function

Date format that depends on the locale.

See more...

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".

© 2010–2019 Google, Inc.
Licensed under the Creative Commons Attribution License 4.0.
https://v6.angular.io/api/common/getLocaleDateFormat