react range datepicker code example
Example 1: datepicker in react
import Datepicker from "react-datepicker";
<Datepicker
required
selected={appDate}
onChange={handleChangeDate}
showTimeSelect
dateFormat="Pp"
className="Datepicker pa2"
minDate={new Date()}
placeholderText="Select a date"
calendarClassName="rasta-stripes"
popperModifiers={{
offset: {
enabled: true,
offset: "0px, 0px"
},
preventOverflow: {
enabled: true,
escapeWithReference: false,
boundariesElement: "scrollParent"
}
}}
/>
Example 2: react date range picker
import { DateRangePicker } from 'rsuite';
Example 3: datepicker range npm reactjs
<DateRangePicker initialSettings={{ startDate: '01/01/2020', endDate: '01/15/2020' }}> <input type="text" className="form-control" /></DateRangePicker>