From 6a33d3d99cc78982c80f53105141132095d23ed0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Fri, 19 Jul 2024 10:52:09 +0800 Subject: [PATCH] hotfix/2.15.1.2407.01 --- .../components/statisticalMicroSettingsSlide.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/reportView/components/statisticalMicroSettingsSlide.js b/pc4mobx/hrmSalary/pages/reportView/components/statisticalMicroSettingsSlide.js index 6b2e496c..a3da8363 100644 --- a/pc4mobx/hrmSalary/pages/reportView/components/statisticalMicroSettingsSlide.js +++ b/pc4mobx/hrmSalary/pages/reportView/components/statisticalMicroSettingsSlide.js @@ -412,7 +412,10 @@ const StatisticalScopePicker = (props) => { { - return current && endDate && current.getTime() > new Date(endDate).getTime(); + if (!current || !endDate) return false; + const start = moment(startDate || endDate).subtract(11, "months").format("YYYY-MM"); + const end = moment(startDate).add(12, "months").format("YYYY-MM"); + return current.getTime() < new Date(start).getTime() || current.getTime() > new Date(endDate || end).getTime(); }} format="YYYY-MM" onChange={(val) => onChange([val, endDate], timeType)} @@ -422,7 +425,11 @@ const StatisticalScopePicker = (props) => { { - return current && startDate && current.getTime() < new Date(startDate).getTime(); + if (!current || !startDate) return false; + const start = moment(endDate).subtract(12, "months").format("YYYY-MM"); + const end = moment(endDate || startDate).add(12, "months").format("YYYY-MM"); + + return current.getTime() > new Date(end).getTime() || current.getTime() < new Date(startDate || start).getTime(); }} format="YYYY-MM" viewAttr={viewAttr}