I want to create a date range component that will fit both start and end dates into a single input. I tried using the example here https://reactdatepicker.com/#example-date-range-for-one-datepicker but it doesnt seem to display the endDate. I've set up a custom input to display both values, but I don't know how to update them both with a single onChange prop in my datePicker. I believe this has caused the component to fail with a RangeError: invalid time value.
const CustomDatePicker = (props) => {
const {
className,
startDateId,
endDateId,
startLabel,
endLabel,
displayFormat,
onStartDateChange,
onEndDateChange,
locale,
startDate,
endDate,
} = props
const CustomInput = ({ value, onClick}) => {
return
<input
className="my-input"
type="text"
onClick={onClick}
value={`${startDate} - ${endDate}`}
/>
</div>
)
return <DatePicker
id={startDateId}
selected={startDate}
selectsRange
startDate={startDate}
endDate={endDate}
placeholderText={placeholder}
dateFormat={displayFormat}
onChange={onStartDateChange}
locale={selectLocale(locale)}
customInput={<CustomInput />}
/>
}