Single Date Selection
Single value selection is the default behavior of the date picker. You can explicitly enable it by setting the selectMultiple to false.
You can dynamically switch between single and multiple select or range select which helps with building a system for one-way and two-way bookings.
Looking for multiple select? See how to enable multi-select →
Demo
<Datepicker
controls={['calendar']}
selectMultiple={false}
/>
<Datepicker
controls={['calendar', 'time']}
selectMultiple={false}
/>
<Datepicker
controls={['calendar', 'timegrid']}
selectMultiple={false}
/>
JSXTSX
import { Datepicker, Page, setOptions } from '@mobiscroll/react';
setOptions({
locale: ,
theme: ' ',
themeVariant: ' '
});
function App() {
return (
<Page>
<Datepicker selectMultiple={false} label="Date" inputStyle="box" labelStyle="stacked" placeholder="Please Select..." />
<Datepicker
controls={['calendar', 'time']}
selectMultiple={false}
label="Date & time"
inputStyle="box"
labelStyle="stacked"
placeholder="Please Select..."
/>
<Datepicker
controls={['calendar', 'timegrid']}
selectMultiple={false}
label="Date & timegrid"
inputStyle="box"
labelStyle="stacked"
placeholder="Please Select..."
/>
</Page>
);
}
export default App;
import { Datepicker, Page, setOptions } from '@mobiscroll/react';
import { FC } from 'react';
setOptions({
locale: ,
theme: ' ',
themeVariant: ' '
});
const App: FC = () => (
<Page>
<Datepicker selectMultiple={false} label="Date" inputStyle="box" labelStyle="stacked" placeholder="Please Select..." />
<Datepicker
controls={['calendar', 'time']}
selectMultiple={false}
label="Date & time"
inputStyle="box"
labelStyle="stacked"
placeholder="Please Select..."
/>
<Datepicker
controls={['calendar', 'timegrid']}
selectMultiple={false}
label="Date & timegrid"
inputStyle="box"
labelStyle="stacked"
placeholder="Please Select..."
/>
</Page>
);
export default App;