当我单击编辑项目按钮时,模态隐藏淡入淡出将显示项目详细信息。我想将更改后的日期值恢复到我的 item.date.sDate 中,但它不起作用。
<div class="modal hide fade" id="editdetails">
<div class="modal-header"><h3>Update Project Information</h3></div>
<div class="modal-body">
<label>Project: </label>
<input type="text" value= {{item.data.project}} class="span3" id="appendedDropdownButton" ng-model="item.data.project"><br>
<label>Start Date: </label>
<input type="text" value= {{item.data.sDate}} class="span3" id="datepicker1" ng-model="item.data.sDate"><br>
<label>End Date: </label>
<input type="text" value= {{item.data.eDate}} class="span3" id="datepicker2" ng-model="item.data.eDate"><br>
</div>
<br>
<div class="modal-footer">
<a href="#" class="btn close_btn" data-dismiss="modal">Close</a>
<a href="#" class="btn btn-primary save_btn" ng-click="update(item.id)">Save Changes</a>
</div>
</div>
关于日期选择器的 Javascript,它们将日期更改为文本。
$( "#datepicker1" ).datepicker({
inline: true,
dateFormat: 'dd/mm/yy',
onSelect: function(dateText) {
$("#datepicker2").datepicker("option","minDate", dateText)
var modelPath = $(this).attr('ng-model');
putObject(modelPath, $scope, dateText);
$scope.$apply();
}
});
$( "#datepicker2" ).datepicker({
inline: true,
dateFormat: 'dd/mm/yy',
onSelect: function(dateText) {
$("#datepicker1").datepicker("option","maxDate", dateText)
var modelPath = $(this).attr('ng-model');
putObject(modelPath, $scope, dateText);
$scope.$apply();
}
});