Permalink
Browse files

fix: 日期组件点击确定的时候控制时间范围

  • Loading branch information...
1 parent 518d0cc commit 9769c225fb38023981343a1692e3cb0acb22e947 liuyk committed Dec 6, 2016
Showing with 12 additions and 1 deletion.
  1. +12 −1 js/neoui-datetimepicker.js
@@ -1308,7 +1308,18 @@ DateTimePicker.fn.onOk = function(){
return;
}
}
- this.setDate(this.pickerDate);
+ var flag = true;
+ if (this.beginDateObj) {
+ if (this.beginDateObj < this.startDate)
+ flag = false;
+ }
+ if (this.overDateObj) {
+ if (this.overDateObj > this.endDate)
+ flag = false;
+ }
+ if(flag){
+ this.setDate(this.pickerDate);
+ }
this.isShow = false;
this.timeOpen = false;
removeClass(this._panel, 'is-visible');

0 comments on commit 9769c22

Please sign in to comment.