Search code examples
javascriptangulartypescriptdatetimedate-pipe

Angular 6 - Date pipe


could some one tell how to achieve below format in angular?.

expected:

20JAN2019

right now with angular default pipe. am getting like

20/01/2019 when using {{slotEndDate | date:'dd/MM/yyyy'}}

do i need write custom pipe to get desired output?

kindly share some examples or demo stackblitz.

Thank you


Solution

  • You can use the built in DatePipe of Angular. See the available formatting options here.

    To format the date to your liking you would need to use ddMMMyyyy.