Skip to content

TypeScript code snippet – angular change How date looks?

// use Angular DatePipe
{{ dateObj | date: 'format desired' }}

{{ dateObj | date:'shortDate' <or> 'M/d/yy' }}    // output is '1/25/21'
{{ dateObj | date:'mediumDate' <or> 'MMM d, y' }} // output is 'Jan 25, 2021'
{{ dateObj | date:'longDate' <or> 'MMMM d, y' }}  // output is 'January 25, 2021'
See also  CSS code snippet - How to keep background image sticky on top?

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.