Skip to content

Commit

Permalink
优化代码逻辑
Browse files Browse the repository at this point in the history
  • Loading branch information
liuyk committed Dec 9, 2016
1 parent ad7d7cd commit c03d3a6
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions js/neoui-datetimepicker.js
Expand Up @@ -1398,11 +1398,29 @@ DateTimePicker.fn.setDate = function(value){

var _date = udate.getDateObj(value);
if(_date){
if(_date && this.options.format == 'YYYY-MM-DD'){
_date.setHours(0);
_date.setMinutes(0);
_date.setSeconds(0);
_date.setMilliseconds(0);
}
if(this.beginDateObj){
if(this.beginDateObj && this.options.format == 'YYYY-MM-DD'){
this.beginDateObj.setHours(0);
this.beginDateObj.setMinutes(0);
this.beginDateObj.setSeconds(0);
this.beginDateObj.setMilliseconds(0);
}
if(_date.getTime() < this.beginDateObj.getTime())
return;
}
if(this.overDateObj){
if(this.overDateObj && this.options.format == 'YYYY-MM-DD'){
this.overDateObj.setHours(0);
this.overDateObj.setMinutes(0);
this.overDateObj.setSeconds(0);
this.overDateObj.setMilliseconds(0);
}
if(_date.getTime() > this.overDateObj.getTime())
return;
}
Expand Down

0 comments on commit c03d3a6

Please sign in to comment.