Moment.js amDateFormat always returning date from 1970

前端 未结 2 844
故里飘歌
故里飘歌 2021-01-11 18:20

http://plnkr.co/edit/5zxXEEz30t51yGhgYWVF?p=preview

I\'m using Moment.js and Angular-moment in my app.

For some reason it\'s converting all

2条回答
  •  無奈伤痛
    2021-01-11 18:20

    Try to write own filter, like this:

     newapp.filter("fromTimestamp", function(){
       return function(timestamp, format){
         return moment.unix(timestamp).format(format)
       }
     })
    

    And use them

    {{date | fromTimestamp:'ffffdd, MMMM Do YYYY'}}

    Plunker demo

提交回复
热议问题