File

core/common/date.pipe.ts

Description

Formats a date value according to locale rules. If no other format specified it defaults to medium used as standard date/time format.

Extends Angular's DatePipe in a way so that date values exceeding the range supported by ECMAScript are displayed as earliest/latest supported point in time printed in the desired format pre- or postfixed by the word before or after, respectively. In all other cases the pipe behaves as the standard DatePipe.

<span class="highlight">{{ deadline | c8yDate }}</span> <!-- e.g. 7 May 2020, 17:45:19 (en-GB) or 07.05.2020, 17:45:19 (de) -->
<span>{{ lastUpdated | c8yDate: 'a h:MM:ss' }}</span> <!-- e.g. pm 5:45:19 -->
<span>{{ 8640000000000000 + 1 | c8yDate }}</span> <!-- e.g. after 13 Sep 275760, 03:00:00 --> ```

Metadata

Methods

transform
transform(value: any, format: string, timezone?: string, locale?: string)
Parameters :
Name Type Optional Default value
value any No
format string No 'medium'
timezone string Yes
locale string Yes
Returns : any

results matching ""

    No results matching ""