Start-end selection
To enable range selection set the select option to range.
The microcopy for rangeStartLabel and rangeEndLabel can be easily overridden. For flight booking "Outbound" and "Return" makes sense while for accommodation booking "Check in" and "Check out" might be more appropriate.
Besides invalidating selection that is before and after a specific date, the minimum and maximum allowed length of a range selection can be enforced through the minRange and maxRange options.
Dynamically switching between single, multiple or range select can be done with option changes.
Demo
<Datepicker
controls={['date ']}
select="range"
showRangeLabels={true }
rangeStartLabel="Outbound "
rangeEndLabel="Return "
minRange={3 }
maxRange={10 }
/>
import { Datepicker, setOptions } from '@mobiscroll/react';
setOptions({
locale: ,
theme: ' ',
themeVariant: ' '
});
function App() {
return (
<div>
<Datepicker
controls={['datetime']}
select="range"
display="inline"
showRangeLabels={true}
rangeStartLabel="Outbound"
rangeEndLabel="Return"
minRange={3}
maxRange={10}
/>
</div>
);
}
export default App;
import { Datepicker, setOptions } from '@mobiscroll/react';
import { FC } from 'react';
setOptions({
locale: ,
theme: ' ',
themeVariant: ' '
});
const App: FC = () => (
<div>
<Datepicker
controls={['datetime']}
select="range"
display="inline"
showRangeLabels={true}
rangeStartLabel="Outbound"
rangeEndLabel="Return"
minRange={3}
maxRange={10}
/>
</div>
);
export default App;