import React, { useState } from 'react'; import { DatePicker, Space } from 'antd'; import type { Dayjs } from 'dayjs'; const App: React.FC = () => { const [startValue, setStartValue] = useState(null); const [endValue, setEndValue] = useState(null); const [endOpen, setEndOpen] = useState(false); const disabledStartDate = (startDate: Dayjs) => { if (!startDate || !endValue) { return false; } return startDate.valueOf() > endValue.valueOf(); }; const disabledEndDate = (endDate: Dayjs) => { if (!endDate || !startValue) { return false; } return endDate.valueOf() <= startValue.valueOf(); }; const handleStartOpenChange = (open: boolean) => { if (!open) { setEndOpen(true); } }; const handleEndOpenChange = (open: boolean) => { setEndOpen(open); }; return ( ); }; export default App;