Angularjs 如何使用angular bootstrap datepicker显示正确的日期格式?

Angularjs 如何使用angular bootstrap datepicker显示正确的日期格式?,angularjs,twitter-bootstrap,Angularjs,Twitter Bootstrap,我正在使用引导数据采集器进行数据采集,但在显示正确的日期格式时遇到问题。我现在得到的格式是: “2015-09-08T00:56:40.272Z”。我想要的格式是dd-mmm-yyy 这是我的日期选择器: <p class="input-group"> selected date:{{dt}} <input type="text" class="form-control" datepicker-popup="{{format}}" ng-model="dt"

我正在使用引导数据采集器进行数据采集,但在显示正确的日期格式时遇到问题。我现在得到的格式是: “2015-09-08T00:56:40.272Z”。我想要的格式是dd-mmm-yyy

这是我的日期选择器:

<p class="input-group">

  selected date:{{dt}}

    <input type="text" class="form-control" datepicker-popup="{{format}}" ng-model="dt"
           is-open="opened" datepicker-options="dateOptions"
           date-disabled="disabled(date, mode)" ng-required="true" close-text="Close" my-date/>

              <span class="input-group-btn">

                <button type="button" class="btn btn-default" ng-click="open($event)"><i
                        class="glyphicon glyphicon-calendar"></i></button>

              </span>
</p>

所选日期:{{dt}

我试过这个:

但没有解决这个问题。如何获得正确的日期格式


plunkr:

你是说你在哪里选择了日期:{{{dt}?您只需使用
date
过滤器将其格式化即可

selected date:{{dt | date:format}}
这是因为您的
dt
模型将是
Date
实例


你是说你在哪里选择了日期:{{dt}?您只需使用
date
过滤器将其格式化即可

selected date:{{dt | date:format}}
这是因为您的
dt
模型将是
Date
实例


当我想在js中设置它时,是否确定?类似于=$filter('date')($scope.dt,$scope.format)的东西?当我想在js中设置它时,可以吗?类似于=$filter('date')($scope.dt,$scope.format)?