Format Date time in AngularJS

后端 未结 13 1794
Happy的楠姐
Happy的楠姐 2020-11-30 22:00

How do I properly display the date and time in AngularJS?

The output below shows both the input and the output, with and without the AngularJS date filter:



        
13条回答
  •  难免孤独
    2020-11-30 22:49

    v.Dt is likely not a Date() object.

    See http://jsfiddle.net/southerd/xG2t8/

    but in your controller:

    scope.v.Dt = Date.parse(scope.v.Dt);
    

提交回复
热议问题