Date pipes

Date pipes transform input data to various date formats that are supported by a date pipe. The syntax of the date pipe is as follows:

expression | date[:format] 

Let's assume that dateData is assigned with Date.now() in a component. The implementation of the date pipe in the template is as shown in the following screenshot:

The template that implements the date pipe

The output of this template after applying various date formats is as follows:

The output of using a date pipe

A date pipe supports various formats, such as medium (yMMMdjms), short (yMdjm), mediumDate (yMMMd), shortDate (yMd), fullDate (yMMMMEEEEd), longDate (yMMMMd), mediumTime (jms), and shortTime (jm).

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset