你可以做一些像這樣:
working jsFiddle
$scope.checkDate = function(AvailableDate){
if(AvailableDate > this.availableDateOptions.maxDate){
$scope.AvailableDate = this.availableDateOptions.maxDate;
}
}
HTML:(添加NG-變化)
<input type="text" class="form-control" uib-datepicker-popup="{{dateFormat}}" ng-model="AvailableDate" ng-change="checkDate(AvailableDate)" name="availabledate" is-open="availableDatePopup.opened" datepicker-options="availableDateOptions" ng-required="true" close-text="Close" ng-click="OpenAvailableDate()"
placeholder="Available Date" />
怎麼樣添加 「只讀」 – Osgux
HTTP:// www.malot.fr/bootstrap-datetimepicker/demo.php – Osgux
@Osgux我怎麼能忘記這個......謝謝 – user7350714