From ad41eb807c713f1e003b9667fe9e9128e45ed1bf Mon Sep 17 00:00:00 2001 From: lmaomaoz <727559597@qq.com> Date: Fri, 8 Jul 2022 11:17:50 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8DdateRange=E7=BB=84?= =?UTF-8?q?=E4=BB=B6minDuration=E5=92=8CmaxDuration=E5=A4=B1=E6=95=88?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98=20(#4820)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: jinye --- packages/amis-ui/src/components/DateRangePicker.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/amis-ui/src/components/DateRangePicker.tsx b/packages/amis-ui/src/components/DateRangePicker.tsx index 14ea29d5b..8f455c895 100644 --- a/packages/amis-ui/src/components/DateRangePicker.tsx +++ b/packages/amis-ui/src/components/DateRangePicker.tsx @@ -920,14 +920,14 @@ export class DateRangePicker extends React.Component< if ( startDate && minDuration && - newValue.isAfter(startDate.clone().add(minDuration)) + newValue.isBefore(startDate.clone().add(minDuration)) ) { newValue = startDate.clone().add(minDuration); } if ( startDate && maxDuration && - newValue.isBefore(startDate.clone().add(maxDuration)) + newValue.isAfter(startDate.clone().add(maxDuration)) ) { newValue = startDate.clone().add(maxDuration); }