react-datepicker icon indicating copy to clipboard operation
react-datepicker copied to clipboard

SelectsMultiple with DateTime or TimeOnly

Open CorradoSurmanowicz opened this issue 1 year ago • 1 comments

Describe the bug

  1. Selecting multiple datetimes (props selectsMultiple & showTimeSelect) crashes when selecting the time.
  2. Selecting multiple times (props selectsMultiple & showTimeSelect & showTimeSelectOnly) does nothing.

To Reproduce Steps to reproduce the behavior: Inline edit on https://reactdatepicker.com/#example-select-multiple-dates Case 1:

() => {
  const [selectedDates, setSelectedDates] = useState([new Date()]);
  const onChange = (dates) => {
    setSelectedDates(dates);
  };
  return (
    <DatePicker
      selectedDates={selectedDates}
      selectsMultiple
      onChange={onChange}
      shouldCloseOnSelect={false}
      disabledKeyboardNavigation
      showTimeSelect
    />
  );
};

Case 2:

() => {
  const [selectedDates, setSelectedDates] = useState([new Date()]);
  const onChange = (dates) => {
    setSelectedDates(dates);
  };
  return (
    <DatePicker
      selectedDates={selectedDates}
      selectsMultiple
      onChange={onChange}
      shouldCloseOnSelect={false}
      disabledKeyboardNavigation
      showTimeSelect
      showTimeSelectOnly
    />
  );
};

Expected behavior Expand the selectsMultiple feature to Datetime and TimeOnly.

CorradoSurmanowicz avatar May 07 '24 10:05 CorradoSurmanowicz

Anyone?

CorradoSurmanowicz avatar Aug 01 '24 14:08 CorradoSurmanowicz