如何使用 xeditable+angularjs 验证日期选择器中的日期?

How to validate dates in datepicker with xeditable+angularjs?

我有两个日期开始日期和结束日期 date.once 我 select 开始日期然后结束日期不应小于开始日期 date.means 这些日期应该被禁用以点击哪个小于结束日期日期选择器中的开始日期。

Html

<div class="col-sm-8">
                      <p class="form-control-static">
                        <span editable-bsdate="data.season_start" e-ng-click="openPicker()"  e-is-open="picker.opened" e-datepicker-popup="dd-MMMM-yyyy">{{ (data.season_start | date:"dd/MM/yyyy") || 'empty' }}</span>
                      </p>
 </div>

<div class="col-sm-8">
                      <p class="form-control-static">
                        <span editable-bsdate="data.season_end" e-ng-click="openPicker2()"  e-is-open="picker2.opened" e-datepicker-popup="dd-MMMM-yyyy">{{ (data.season_end | date:"dd/MM/yyyy") || 'empty' }}</span>
                      </p>
 </div>

Angular :

 $scope.picker = {opened: false};
 $scope.openPicker = function (data) {
                    $scope.picker.opened = true;
             });
  };
    $scope.picker2 = {opened: false};
    $scope.openPicker2 = function (data) {
                    $scope.picker.opened = true;
                });
        };

我的日期选择器正在工作 fine.but 我想根据 season_start.thanks

在 season_end 日期选择器中验证

正如 akashrajkn 在上面的评论中所写,您可以简单地将最小日期与范围变量一起使用 这是一个关于如何使用最小和最大日期的示例。plunker

取自AngularUI Datepicker dynamic date disabling

 <h4>Start</h4>
<div class="form-horizontal">
    <p>
        <input type="text" datepicker-popup="{{format}}" ng-model="start" is-open="startOpened" min="minStartDate" max="maxStartDate" datepicker-options="dateOptions" close-text="Close" />
        <button class="btn" ng-click="openStart()"><i class="icon-calendar"></i></button>
    </p>
</div>
<h4>End</h4>
<div class="form-horizontal">
    <p>
        <input type="text" datepicker-popup="{{format}}" ng-model="end" is-open="endOpened" min="minEndDate" max="maxEndDate" datepicker-options="dateOptions" close-text="Close" />
        <button class="btn" ng-click="openEnd()"><i class="icon-calendar"></i></button>
    </p>
</div>

并在控制器中执行您需要的操作。