Browse Source

时间控件的些许问题

es6
windy 7 years ago
parent
commit
b38d6ee6b3
  1. 17
      dist/bundle.js
  2. 4
      dist/case.js
  3. 13
      dist/widget.js
  4. 4
      src/case/calendar/calendar.js
  5. 13
      src/widget/datepane/card.static.datepane.js

17
dist/bundle.js vendored

@ -73708,7 +73708,7 @@ BI.extend(BI.Calendar, {
var year = BI.getDate().getFullYear();
var month = BI.getDate().getMonth();
var page = (json.year - year) * 12;
page += json.month - month;
page += json.month - 1 - month;
return page;
},
getDateJSONByPage: function (v) {
@ -73725,7 +73725,7 @@ BI.extend(BI.Calendar, {
var month = page >= 0 ? (page % 12) : ((12 + page % 12) % 12);
return {
year: BI.getDate().getFullYear() + year,
month: month
month: month + 1
};
}
});
@ -87998,8 +87998,19 @@ BI.StaticDatePaneCard = BI.inherit(BI.Widget, {
max: o.max
});
this.datePicker.on(BI.DatePicker.EVENT_CHANGE, function () {
self.selectedTime = self.datePicker.getValue();
var value = self.datePicker.getValue();
var monthDay = BI.getDate(value.year, value.month - 1, 1).getMonthDays();
var day = self.selectedTime.day || 0;
if (day > monthDay) {
day = monthDay;
}
self.selectedTime = {
year: value.year,
month: value.month,
day: day
};
self.calendar.setSelect(BI.Calendar.getPageByDateJSON(self.selectedTime));
self.calendar.setValue(self.selectedTime);
});
this.calendar = BI.createWidget({

4
dist/case.js vendored

@ -1768,7 +1768,7 @@ BI.extend(BI.Calendar, {
var year = BI.getDate().getFullYear();
var month = BI.getDate().getMonth();
var page = (json.year - year) * 12;
page += json.month - month;
page += json.month - 1 - month;
return page;
},
getDateJSONByPage: function (v) {
@ -1785,7 +1785,7 @@ BI.extend(BI.Calendar, {
var month = page >= 0 ? (page % 12) : ((12 + page % 12) % 12);
return {
year: BI.getDate().getFullYear() + year,
month: month
month: month + 1
};
}
});

13
dist/widget.js vendored

@ -1487,8 +1487,19 @@ BI.StaticDatePaneCard = BI.inherit(BI.Widget, {
max: o.max
});
this.datePicker.on(BI.DatePicker.EVENT_CHANGE, function () {
self.selectedTime = self.datePicker.getValue();
var value = self.datePicker.getValue();
var monthDay = BI.getDate(value.year, value.month - 1, 1).getMonthDays();
var day = self.selectedTime.day || 0;
if (day > monthDay) {
day = monthDay;
}
self.selectedTime = {
year: value.year,
month: value.month,
day: day
};
self.calendar.setSelect(BI.Calendar.getPageByDateJSON(self.selectedTime));
self.calendar.setValue(self.selectedTime);
});
this.calendar = BI.createWidget({

4
src/case/calendar/calendar.js

@ -177,7 +177,7 @@ BI.extend(BI.Calendar, {
var year = BI.getDate().getFullYear();
var month = BI.getDate().getMonth();
var page = (json.year - year) * 12;
page += json.month - month;
page += json.month - 1 - month;
return page;
},
getDateJSONByPage: function (v) {
@ -194,7 +194,7 @@ BI.extend(BI.Calendar, {
var month = page >= 0 ? (page % 12) : ((12 + page % 12) % 12);
return {
year: BI.getDate().getFullYear() + year,
month: month
month: month + 1
};
}
});

13
src/widget/datepane/card.static.datepane.js

@ -30,8 +30,19 @@ BI.StaticDatePaneCard = BI.inherit(BI.Widget, {
max: o.max
});
this.datePicker.on(BI.DatePicker.EVENT_CHANGE, function () {
self.selectedTime = self.datePicker.getValue();
var value = self.datePicker.getValue();
var monthDay = BI.getDate(value.year, value.month - 1, 1).getMonthDays();
var day = self.selectedTime.day || 0;
if (day > monthDay) {
day = monthDay;
}
self.selectedTime = {
year: value.year,
month: value.month,
day: day
};
self.calendar.setSelect(BI.Calendar.getPageByDateJSON(self.selectedTime));
self.calendar.setValue(self.selectedTime);
});
this.calendar = BI.createWidget({

Loading…
Cancel
Save