mirror of
https://gitee.com/baidu/amis.git
synced 2024-12-02 12:08:13 +08:00
fix: 修复dateRange组件minDuration和maxDuration失效的问题 (#4820)
Co-authored-by: jinye <jinye@baidu.com>
This commit is contained in:
parent
c61787bc7a
commit
ad41eb807c
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user