import React from 'react'; import { DatePicker, Space, Typography } from 'antd'; import type { DatePickerProps } from 'antd'; const { RangePicker } = DatePicker; // Disabled 7 days from the selected date const disabled7DaysDate: DatePickerProps['disabledDate'] = (current, { from }) => { if (from) { return Math.abs(current.diff(from, 'days')) >= 7; } return false; }; // Disabled 6 months from the selected date const disabled6MonthsDate: DatePickerProps['disabledDate'] = (current, { from }) => { if (from) { const curMonth = current.year() * 12 + current.month(); const fromMonth = from.year() * 12 + from.month(); return Math.abs(fromMonth - curMonth) >= 6; } return false; }; const App: React.FC = () => ( 7 days range 6 months range ); export default App;