Angular2 date pipe does not work in IE 11 and edge 13/14

前端 未结 8 1361
闹比i
闹比i 2020-12-05 09:50

I\'m using Angular 2.0 final, and I have an incorrect format of dates when I add hours and minutes in the format string:

In the template of the component, I have:

8条回答
  •  囚心锁ツ
    2020-12-05 10:02

    If you are okay with showing AM/PM instead of 24 hour time, another valid workaround is to break the formatting into two, and use shortTime or mediumTime for displaying the time portion:

    {{dto.LastExecution | date:'yyyy-MM-dd'}} {{dto.LastExecution | date:'shortTime'}}

    This should work in all major browsers, including IE and Edge.

提交回复
热议问题