demo(date-picker-demo): fix select-in-range demo (#41161)

This commit is contained in:
Luyiin 2023-03-20 10:49:08 +08:00 committed by GitHub
parent b915094498
commit d5ef496bb6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -14,8 +14,8 @@ const App: React.FC = () => {
if (!dates) {
return false;
}
const tooLate = dates[0] && current.diff(dates[0], 'days') > 7;
const tooEarly = dates[1] && dates[1].diff(current, 'days') > 7;
const tooLate = dates[0] && current.diff(dates[0], 'days') >= 7;
const tooEarly = dates[1] && dates[1].diff(current, 'days') >= 7;
return !!tooEarly || !!tooLate;
};