当用户使用angular-ui Datepicker输入日期范围时,我想要注意EndDate
设置' StartDate`。
在我看来,
<div class="input-daterange input-group" id="datepicker">
<input type="text" class="input form-control" name="ev_StartDate"
ng-model="evStartDate" ng-required="true" is-open="startPop.opened"
ng-focus="openStart()" uib-datepicker-popup="{{format}}"
alt-input-formats="altInputFormats" datepicker-options="startDateOptions"
readonly="true">
<span class="input-group-addon">~</span>
<input type="text" class="input form-control" name="ev_EndDate"
ng-model="evEndDate" ng-required="true" is-open="endPop.opened"
ng-focus="openEnd()" uib-datepicker-popup="{{format}}"
alt-input-formats="altInputFormats" datepicker-options="endDateOptions"
readonly="true">
</div>
哪个指令正确使用?
$scope.startDateOptions = {
showWeeks: false,
startingDay: 1
};
$scope.setOption = function() {
????????
};
$scope.endDateOptions = {
showWeeks: false,
startingDay: 1,
minDate: ?????
};
答案 0 :(得分:2)
您可以使用min-date
属性,您可以直接传入startdate的范围变量evStartDate
。将以下属性添加到结束日期输入元素。
min-date="evStartDate"