getLocaleDateTimeFormat
function experimental
| npm Package | @angular/common |
|---|---|
| Module | import { getLocaleDateTimeFormat } from '@angular/common'; |
| Source | common/src/i18n/locale_data_api.ts |
function getLocaleDateTimeFormat(locale: string, width: FormatWidth): string;
Description
Date-time format that depends on the locale.
The date-time pattern shows how to combine separate patterns for date (represented by {1}) and time (represented by {0}) into a single pattern. It usually doesn't need to be changed. What you want to pay attention to are:
- possibly removing a space for languages that don't use it, such as many East Asian languages
- possibly adding a comma, other punctuation, or a combining word
For example:
- English uses
{1} 'at' {0}or{1}, {0}(depending on date style), while Japanese uses{1}{0}. - An English formatted date-time using the combining pattern
{1}, {0}could beDec 10, 2010, 3:59:49 PM. Notice the comma and space between the date portion and the time portion.
There are four formats (full, long, medium, short); the determination of which to use is normally based on the date style. For example, if the date has a full month and weekday name, the full combining pattern will be used to combine that with a time. If the date has numeric month, the short version of the combining pattern will be used to combine that with a time. English uses {1} 'at' {0} for full and long styles, and {1}, {0} for medium and short styles.
© 2010–2018 Google, Inc.
Licensed under the Creative Commons Attribution License 4.0.
https://v5.angular.io/api/common/getLocaleDateTimeFormat