Browse Source

datepicker

master
windy 7 years ago
parent
commit
b2be79e79d
  1. 2
      Gruntfile.js
  2. 11142
      bi/core.js
  3. 22
      bi/widget.js
  4. 22
      dist/bundle.js
  5. 22
      dist/bundle.min.js
  6. 22
      dist/widget.js
  7. 22
      src/widget/date/calendar/picker.date.js

2
Gruntfile.js

@ -154,6 +154,8 @@ module.exports = function (grunt) {
bi_coreJs: {
src: [
'src/core/jquery.js',
'src/core/underscore.js',
'src/core/foundation.js',
'src/core/mvc/**/*.js',
'src/core/base.js',

11142
bi/core.js

File diff suppressed because it is too large Load Diff

22
bi/widget.js

@ -2007,6 +2007,8 @@ BI.DatePicker = BI.inherit(BI.Widget, {
})
}
self.fireEvent(BI.DatePicker.EVENT_CHANGE);
self._checkLeftValid();
self._checkRightValid();
});
this.right = BI.createWidget({
@ -2029,6 +2031,8 @@ BI.DatePicker = BI.inherit(BI.Widget, {
})
}
self.fireEvent(BI.DatePicker.EVENT_CHANGE);
self._checkLeftValid();
self._checkRightValid();
});
this.year = BI.createWidget({
@ -2078,11 +2082,29 @@ BI.DatePicker = BI.inherit(BI.Widget, {
})
},
_checkLeftValid: function () {
var o = this.options;
var valid = !(this._month === 0 && this._year === Date.parseDateTime(o.min, "%Y-%X-%d").getFullYear());
this.left.setEnable(valid);
return valid;
},
_checkRightValid: function () {
var o = this.options;
var valid = !(this._month === 11 && this._year === Date.parseDateTime(o.max, "%Y-%X-%d").getFullYear());
this.right.setEnable(valid);
return valid;
},
setValue: function (ob) {
this._year = ob.year;
this._month = ob.month;
this.year.setValue(ob.year);
this.month.setValue(ob.month);
this._checkLeftValid();
this._checkRightValid();
},
getValue: function () {

22
dist/bundle.js vendored

@ -80506,6 +80506,8 @@ BI.DatePicker = BI.inherit(BI.Widget, {
})
}
self.fireEvent(BI.DatePicker.EVENT_CHANGE);
self._checkLeftValid();
self._checkRightValid();
});
this.right = BI.createWidget({
@ -80528,6 +80530,8 @@ BI.DatePicker = BI.inherit(BI.Widget, {
})
}
self.fireEvent(BI.DatePicker.EVENT_CHANGE);
self._checkLeftValid();
self._checkRightValid();
});
this.year = BI.createWidget({
@ -80577,11 +80581,29 @@ BI.DatePicker = BI.inherit(BI.Widget, {
})
},
_checkLeftValid: function () {
var o = this.options;
var valid = !(this._month === 0 && this._year === Date.parseDateTime(o.min, "%Y-%X-%d").getFullYear());
this.left.setEnable(valid);
return valid;
},
_checkRightValid: function () {
var o = this.options;
var valid = !(this._month === 11 && this._year === Date.parseDateTime(o.max, "%Y-%X-%d").getFullYear());
this.right.setEnable(valid);
return valid;
},
setValue: function (ob) {
this._year = ob.year;
this._month = ob.month;
this.year.setValue(ob.year);
this.month.setValue(ob.month);
this._checkLeftValid();
this._checkRightValid();
},
getValue: function () {

22
dist/bundle.min.js vendored

File diff suppressed because one or more lines are too long

22
dist/widget.js vendored

@ -2007,6 +2007,8 @@ BI.DatePicker = BI.inherit(BI.Widget, {
})
}
self.fireEvent(BI.DatePicker.EVENT_CHANGE);
self._checkLeftValid();
self._checkRightValid();
});
this.right = BI.createWidget({
@ -2029,6 +2031,8 @@ BI.DatePicker = BI.inherit(BI.Widget, {
})
}
self.fireEvent(BI.DatePicker.EVENT_CHANGE);
self._checkLeftValid();
self._checkRightValid();
});
this.year = BI.createWidget({
@ -2078,11 +2082,29 @@ BI.DatePicker = BI.inherit(BI.Widget, {
})
},
_checkLeftValid: function () {
var o = this.options;
var valid = !(this._month === 0 && this._year === Date.parseDateTime(o.min, "%Y-%X-%d").getFullYear());
this.left.setEnable(valid);
return valid;
},
_checkRightValid: function () {
var o = this.options;
var valid = !(this._month === 11 && this._year === Date.parseDateTime(o.max, "%Y-%X-%d").getFullYear());
this.right.setEnable(valid);
return valid;
},
setValue: function (ob) {
this._year = ob.year;
this._month = ob.month;
this.year.setValue(ob.year);
this.month.setValue(ob.month);
this._checkLeftValid();
this._checkRightValid();
},
getValue: function () {

22
src/widget/date/calendar/picker.date.js

@ -38,6 +38,8 @@ BI.DatePicker = BI.inherit(BI.Widget, {
})
}
self.fireEvent(BI.DatePicker.EVENT_CHANGE);
self._checkLeftValid();
self._checkRightValid();
});
this.right = BI.createWidget({
@ -60,6 +62,8 @@ BI.DatePicker = BI.inherit(BI.Widget, {
})
}
self.fireEvent(BI.DatePicker.EVENT_CHANGE);
self._checkLeftValid();
self._checkRightValid();
});
this.year = BI.createWidget({
@ -109,11 +113,29 @@ BI.DatePicker = BI.inherit(BI.Widget, {
})
},
_checkLeftValid: function () {
var o = this.options;
var valid = !(this._month === 0 && this._year === Date.parseDateTime(o.min, "%Y-%X-%d").getFullYear());
this.left.setEnable(valid);
return valid;
},
_checkRightValid: function () {
var o = this.options;
var valid = !(this._month === 11 && this._year === Date.parseDateTime(o.max, "%Y-%X-%d").getFullYear());
this.right.setEnable(valid);
return valid;
},
setValue: function (ob) {
this._year = ob.year;
this._month = ob.month;
this.year.setValue(ob.year);
this.month.setValue(ob.month);
this._checkLeftValid();
this._checkRightValid();
},
getValue: function () {

Loading…
Cancel
Save