【问题标题】:Want to change the format from datetime to date in AngularJS想在AngularJS中将格式从日期时间更改为日期
【发布时间】:2020-02-19 10:19:50
【问题描述】:

这就是我尝试的方式,但语法错误

$scope.A[index].mydatetime | date: 'd-MMM-y' ;

但它发生在里面:

 {{" mydatetime |  date: 'd-MMM-y'"}}

【问题讨论】:

  • 你能详细说明你的问题吗

标签: angularjs date datetime datepicker


【解决方案1】:

这样试试

$scope.formattedDate =   $filter('date')($scope.currDate, "dd-MM-yyyy");

Following formats are supported by angular.

【讨论】:

    猜你喜欢
    • 2019-02-05
    • 2016-09-15
    • 1970-01-01
    • 2020-01-30
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-09-28
    • 2018-09-12
    相关资源
    最近更新 更多