Search code examples
angularangular-pipe

Angular Date Pipe skip optional parameter format while providing timezone


I need to supply the timezone (+0000) to the Date pipe since i am using UTC timestamps as following:

 | date:'dd.MM.yyyy':'+0000'

Since America is using "MM.dd.yyyy" i would like to not specify the format pipe argument.

I Tried supplying false, null and 0 but those break the pipe.

how can i skip optional parameters in angular pipes or specifically the date pipe?


Solution

  • Just supply undefined as argument:

    (dateVariable  | date:undefined:'+0000'