Angularjs 引导datetimepicker未显示数据库中的日期

Angularjs 引导datetimepicker未显示数据库中的日期,angularjs,twitter-bootstrap,datetimepicker,Angularjs,Twitter Bootstrap,Datetimepicker,我的html代码: <input type="text" class="form-control" name="calLeaseStartDate" required ng-model="item.StartDate" datetimepicker-format="MM/DD/YYYY" options="gridDatePickerOption" placeholder="Start Date" /> <span class="input-group-addon">

我的html代码:

<input type="text" class="form-control" name="calLeaseStartDate" 
required ng-model="item.StartDate" 
datetimepicker-format="MM/DD/YYYY" options="gridDatePickerOption"
placeholder="Start Date" />
<span class="input-group-addon">
<span class="glyphicon glyphicon-calendar"></span>
</span>
这是一个角度的应用。此日期位于html格式的表中。选择日期并保存在数据库中时,它工作正常。但它在加载时不显示数据库中的日期


感谢您的帮助。谢谢。

尝试存储
$scope.item.StartDate=moment(item.StartDate).format(“MM/DD/YYYY”)@Pradeepb。。精彩的。。这显示了所需的日期,但显示的是2020-07-01T00:00:00,我给出的格式是MM/DD/YYYY。。谢谢,它应该能正常工作。你能公布你从db收到的StartDate的价值吗?@Pradeepb抱歉。它不起作用..我测试了删除html中的“datetimepicker”,它确实显示了日期。。但是拾荒者是行不通的。。我在这个阶段测试了添加范围。。一旦我添加回“datetimepicker”,它就不起作用了。。当我使用范围时,它无法设置未定义或空引用的属性StartDate。item是foreach条件中的对象。请看这个示例。尝试存储
$scope.item.StartDate=moment(item.StartDate).format(“MM/DD/YYYY”)@Pradeepb。。精彩的。。这显示了所需的日期,但显示的是2020-07-01T00:00:00,我给出的格式是MM/DD/YYYY。。谢谢,它应该能正常工作。你能公布你从db收到的StartDate的价值吗?@Pradeepb抱歉。它不起作用..我测试了删除html中的“datetimepicker”,它确实显示了日期。。但是拾荒者是行不通的。。我在这个阶段测试了添加范围。。一旦我添加回“datetimepicker”,它就不起作用了。。当我使用范围时,它无法设置未定义或空引用的属性StartDate。item是foreach条件中的对象。请看这个示例。
angular.forEach($scope.commissionStatement.ComLeaseCalcList, function(item) {
    if (!angular.isUndefined(item.StartDate))
    {
        if (item.StartDate !== null) {
            item.StartDate = moment(item.StartDate).format("MM/DD/YYYY");                      
        }
     }                     
});