Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SelectsMultiple with DateTime or TimeOnly #4776

Open
CorradoSurmanowicz opened this issue May 7, 2024 · 0 comments
Open

SelectsMultiple with DateTime or TimeOnly #4776

CorradoSurmanowicz opened this issue May 7, 2024 · 0 comments

Comments

@CorradoSurmanowicz
Copy link

CorradoSurmanowicz commented May 7, 2024

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 CorradoSurmanowicz changed the title SelectsMultiple with showTimeSelect or showTimeSelectOnly SelectsMultiple with DateTime or TimeOnly May 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant