Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Angular 2 weekday Pipe

Tags:

angular

I want to use the date pipe in angular 2. but I need this output: Wednesday.

I know I can get this.

{{ strDate | date :'fullDate' }} 

Output will be: Monday, November 7, 2016.

but I don't want the year.

or this.

{{ strDate | date :'longDate'}} 

Output will be: November 7, 2016,

also, don't want the year.

how can I get just the weekday or November 7.

like image 751
Mel Pacheco Avatar asked Jan 21 '26 11:01

Mel Pacheco


1 Answers

Check out the Angular documentation

It describes that you can define your desired output string by using an ISO string. In your case, the following entry should have the output you desire:

{{ strDate | date :'EEEE'}} -> Saturday

{{ strDate | date :'MMMM d'}} -> May 20

like image 193
Jens Habegger Avatar answered Jan 24 '26 12:01

Jens Habegger



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!