Angular2 – DatePipe period in lower case.

There are several occasions customer would have requested to change the date format in your application to be in small case as follows.

Tuesday, December 19, 7:00 am 

Since the date format does not support the above format, either we can display entire thing in small case with the  lowercase pipe

Since it converts the whole format in lowercase, you can split it in two and apply the lowercase only for the period as follows

{1234567 | date:'EEEE, MMMM d, h:mm '} {1234567 l date:' a' | lowercase }

that’s it, it is easier rather than using a custom pipe! Here is the working demo

Advertisements

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

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