windy 4 years ago
parent
commit
2250ed8172
  1. 14
      src/widget/dynamicdate/dynamicdate.card.js
  2. 4
      src/widget/year/card.dynamic.year.js
  3. 4
      src/widget/yearmonth/card.dynamic.yearmonth.js
  4. 4
      src/widget/yearquarter/card.dynamic.yearquarter.js

14
src/widget/dynamicdate/dynamicdate.card.js

@ -284,22 +284,22 @@ BI.DynamicDateCard = BI.inherit(BI.Widget, {
var valueMap = {};
switch (value.dateType) {
case BI.DynamicDateCard.TYPE.YEAR:
valueMap.year = (value.offset === 0 ? -value.value : value.value);
valueMap.year = (value.offset === 0 ? -value.value : +value.value);
break;
case BI.DynamicDateCard.TYPE.QUARTER:
valueMap.quarter = (value.offset === 0 ? -value.value : value.value);
valueMap.quarter = (value.offset === 0 ? -value.value : +value.value);
break;
case BI.DynamicDateCard.TYPE.MONTH:
valueMap.month = (value.offset === 0 ? -value.value : value.value);
valueMap.month = (value.offset === 0 ? -value.value : +value.value);
break;
case BI.DynamicDateCard.TYPE.WEEK:
valueMap.week = (value.offset === 0 ? -value.value : value.value);
valueMap.week = (value.offset === 0 ? -value.value : +value.value);
break;
case BI.DynamicDateCard.TYPE.DAY:
valueMap.day = (value.offset === 0 ? -value.value : value.value);
valueMap.day = (value.offset === 0 ? -value.value : +value.value);
break;
case BI.DynamicDateCard.TYPE.WORK_DAY:
valueMap.workDay = (value.offset === 0 ? -value.value : value.value);
valueMap.workDay = (value.offset === 0 ? -value.value : +value.value);
break;
default:
break;
@ -369,7 +369,7 @@ BI.DynamicDateCard = BI.inherit(BI.Widget, {
}
if(this.workDayBox.isSelected()) {
var value = buttons[0].getValue();
valueMap.workDay = (value.offset === 0 ? -value.value : value.value);
valueMap.workDay = (value.offset === 0 ? -value.value : +value.value);
}
return valueMap;
}

4
src/widget/year/card.dynamic.year.js

@ -48,7 +48,7 @@ BI.DynamicYearCard = BI.inherit(BI.Widget, {
_checkDate: function (obj) {
var o = this.options;
var date = BI.DynamicDateHelper.getCalculation({
year: (obj.offset === 0 ? -obj.value : obj.value)
year: (obj.offset === 0 ? -obj.value : +obj.value)
});
return !BI.checkDateVoid(date.getFullYear(), date.getMonth() + 1, date.getDate(), o.min, o.max)[0];
@ -82,7 +82,7 @@ BI.DynamicYearCard = BI.inherit(BI.Widget, {
getValue: function () {
var value = this.item.getValue();
return {
year: (value.offset === 0 ? -value.value : value.value)
year: (value.offset === 0 ? -value.value : +value.value)
};
}
});

4
src/widget/yearmonth/card.dynamic.yearmonth.js

@ -76,10 +76,10 @@ BI.DynamicYearMonthCard = BI.inherit(BI.Widget, {
var valueMap = {};
switch (value.dateType) {
case BI.DynamicDateCard.TYPE.YEAR:
valueMap.year = (value.offset === 0 ? -value.value : value.value);
valueMap.year = (value.offset === 0 ? -value.value : +value.value);
break;
case BI.DynamicDateCard.TYPE.MONTH:
valueMap.month = (value.offset === 0 ? -value.value : value.value);
valueMap.month = (value.offset === 0 ? -value.value : +value.value);
break;
default:
break;

4
src/widget/yearquarter/card.dynamic.yearquarter.js

@ -76,10 +76,10 @@ BI.DynamicYearQuarterCard = BI.inherit(BI.Widget, {
var valueMap = {};
switch (value.dateType) {
case BI.DynamicDateCard.TYPE.YEAR:
valueMap.year = (value.offset === 0 ? -value.value : value.value);
valueMap.year = (value.offset === 0 ? -value.value : +value.value);
break;
case BI.DynamicDateCard.TYPE.MONTH:
valueMap.quarter = (value.offset === 0 ? -value.value : value.value);
valueMap.quarter = (value.offset === 0 ? -value.value : +value.value);
break;
default:
break;

Loading…
Cancel
Save