How to implement moment.js as a pipe in an Angular2 project

后端 未结 4 1762
有刺的猬
有刺的猬 2020-12-30 09:35

I would like to implement moment.js library inside an angular2 project i order to convert a UTC time to a certain time zone Europe/london and that

4条回答
  •  说谎
    说谎 (楼主)
    2020-12-30 10:06

    Use ngx-moment - it's an awesome moment.js wrapper designed for Angular 2+.

    It can do pretty much anything you need out of the box, and in your case:

     {{time.bookingTime.iso | amDateFormat:'MMMM Do YYYY, h:mm:ss a'}} 
    

提交回复
热议问题