我尝试了很多方法,但没有成功。
我想从x-editable中的日期选择器中禁用将来的日期选择。
这是我的html代码。
<a href="#" editable-bsdate="TeamData.selectedDate"
onshow="openPicker()"
onhide="closePicker()"
e-is-open="TeamData.pickeropened"
e-datepicker-popup="dd/MM/yyyy">
{{ (TeamData.selectedDate | date:"dd/MM/yyyy") || 'empty'}}
</a>
这是js代码
var date = new Date();
date = $scope.TeamData.selectedDate.toLocaleDateString();
//function for date picker when picker is open
function openPicker() {
$timeout(function () {
$scope.TeamData.pickeropened = true;
});
}
//function for date picker when picker is close
function closePicker() {
$scope.TeamData.pickeropened = false;
}
最佳答案
终于我成功了
在html中添加e-max-Date ='TeamData.maxEndDate'并设置
$ scope.maxEndDate =新的Date();在js文件中
<a href="#" editable-bsdate="TeamData.selectedDate"
onshow="openPicker()"
onhide="closePicker()"
e-is-open="TeamData.pickeropened"
e-max-Date='TeamData.maxEndDate'
e-datepicker-popup="dd/MM/yyyy">
{{ (TeamData.selectedDate | date:"dd/MM/yyyy") || 'empty'}} </a>