0

Have used currentDate = new Date(); in my typescript file and tried to render by using {{currentDate}} but it shows full format like Sun Aug 06 2017 15:36:11 GMT+0530 (IST).

I took reference from AngularDatePipe , then i render {{currentDate | date}} now it shows like Aug 6, 2017 . But what i want is just day with starting 3 char only like Sun , Sat .. and so is there any way to retrieve it from this format Sun Aug 06 2017 15:36:11 GMT+0530 (IST).

angular.aditya
  • 115
  • 1
  • 1
  • 10
  • *I took reference from `AngularDatePipe`* Is there some reason you did not actually read that page, which could not describe the `EEE` option any more clearly? –  Aug 06 '17 at 10:49

3 Answers3

3

You can use the short form ": EEE" after the date pipe.

{{currentDate | date : 'EEE'}}

Check this link for different formats date filter

1

{{ today | date : "EEE" }}

EEE should give you a three letter day

user3365957
  • 308
  • 1
  • 2
  • 11
0

You should be using EEE

     <p>{{today | date:'EEE'}}</p>

Use the method as per this post and use that array in the DOM.

LIVE DEMO

Aravind
  • 40,391
  • 16
  • 91
  • 110