diff --git a/dist/bundle.js b/dist/bundle.js index ac3fe196b..1e5a2358b 100644 --- a/dist/bundle.js +++ b/dist/bundle.js @@ -90357,8 +90357,18 @@ BI.shortcut("bi.down_list_popup", BI.DownListPopup);/** date = date.getOffsetDate(BI.parseInt(obj.day)); } if (BI.isNotNull(obj.workDay)) { - // todo 根据工作日做偏移 暂时按天偏移 - date = date.getOffsetDate(BI.parseInt(obj.workDay)); + // 配置了节假日就按照节假日计算工作日偏移,否则按正常的天去算 + if(BI.isNotNull(Date.holidays)) { + var count = Math.abs(obj.workDay); + for (var i = 0; i < count; i++) { + date = date.getOffsetDate(obj.workDay < 0 ? -1 : 1); + if(BI.isNotNull(Date.holidays[date.print("%Y-%X-%d")])) { + i--; + } + } + } else { + date = date.getOffsetDate(BI.parseInt(obj.workDay)); + } } if (BI.isNotNull(obj.position) && obj.position !== BI.DynamicDateCard.OFFSET.CURRENT) { date = this.getBeginDate(date, obj); diff --git a/dist/fineui.js b/dist/fineui.js index ad917b9ed..3ff5719e7 100644 --- a/dist/fineui.js +++ b/dist/fineui.js @@ -90600,8 +90600,18 @@ BI.shortcut("bi.down_list_popup", BI.DownListPopup);/** date = date.getOffsetDate(BI.parseInt(obj.day)); } if (BI.isNotNull(obj.workDay)) { - // todo 根据工作日做偏移 暂时按天偏移 - date = date.getOffsetDate(BI.parseInt(obj.workDay)); + // 配置了节假日就按照节假日计算工作日偏移,否则按正常的天去算 + if(BI.isNotNull(Date.holidays)) { + var count = Math.abs(obj.workDay); + for (var i = 0; i < count; i++) { + date = date.getOffsetDate(obj.workDay < 0 ? -1 : 1); + if(BI.isNotNull(Date.holidays[date.print("%Y-%X-%d")])) { + i--; + } + } + } else { + date = date.getOffsetDate(BI.parseInt(obj.workDay)); + } } if (BI.isNotNull(obj.position) && obj.position !== BI.DynamicDateCard.OFFSET.CURRENT) { date = this.getBeginDate(date, obj); diff --git a/dist/widget.js b/dist/widget.js index 362385c04..9f591f72e 100644 --- a/dist/widget.js +++ b/dist/widget.js @@ -2778,8 +2778,18 @@ BI.shortcut("bi.down_list_popup", BI.DownListPopup);/** date = date.getOffsetDate(BI.parseInt(obj.day)); } if (BI.isNotNull(obj.workDay)) { - // todo 根据工作日做偏移 暂时按天偏移 - date = date.getOffsetDate(BI.parseInt(obj.workDay)); + // 配置了节假日就按照节假日计算工作日偏移,否则按正常的天去算 + if(BI.isNotNull(Date.holidays)) { + var count = Math.abs(obj.workDay); + for (var i = 0; i < count; i++) { + date = date.getOffsetDate(obj.workDay < 0 ? -1 : 1); + if(BI.isNotNull(Date.holidays[date.print("%Y-%X-%d")])) { + i--; + } + } + } else { + date = date.getOffsetDate(BI.parseInt(obj.workDay)); + } } if (BI.isNotNull(obj.position) && obj.position !== BI.DynamicDateCard.OFFSET.CURRENT) { date = this.getBeginDate(date, obj); diff --git a/src/widget/dynamicdate/dynamicdate.caculate.js b/src/widget/dynamicdate/dynamicdate.caculate.js index 649b36729..75ad50dac 100644 --- a/src/widget/dynamicdate/dynamicdate.caculate.js +++ b/src/widget/dynamicdate/dynamicdate.caculate.js @@ -28,8 +28,18 @@ date = date.getOffsetDate(BI.parseInt(obj.day)); } if (BI.isNotNull(obj.workDay)) { - // todo 根据工作日做偏移 暂时按天偏移 - date = date.getOffsetDate(BI.parseInt(obj.workDay)); + // 配置了节假日就按照节假日计算工作日偏移,否则按正常的天去算 + if(BI.isNotNull(Date.holidays)) { + var count = Math.abs(obj.workDay); + for (var i = 0; i < count; i++) { + date = date.getOffsetDate(obj.workDay < 0 ? -1 : 1); + if(BI.isNotNull(Date.holidays[date.print("%Y-%X-%d")])) { + i--; + } + } + } else { + date = date.getOffsetDate(BI.parseInt(obj.workDay)); + } } if (BI.isNotNull(obj.position) && obj.position !== BI.DynamicDateCard.OFFSET.CURRENT) { date = this.getBeginDate(date, obj);