Hacker0x01 / react-datepicker

A simple and reusable datepicker component for React
https://reactdatepicker.com/
MIT License
8.1k stars 2.24k forks source link

YearPicker when selecting range doesn't apply classnames correctly #3662

Open javsand opened 2 years ago

javsand commented 2 years ago

Describe the bug When showYearPicker and selectsRange props are set. Selecting two years does not apply range-start, in-range, nor range-end classnames.

To Reproduce Steps to reproduce the behavior:

1- Create picker with showYearPicker and selectsRange prop 2- Click 2 different years (e.g 2004 and 2022)

Expected behavior Day names within the selected range should have range classnames

shreekeshmurkar commented 2 years ago

@javsand How are you able to select date after applying showYearPicker ? Can you provide sample code or a sandbox link for the same ?

javsand commented 2 years ago

Sorry, didn't mean dates. I meant '...Selecting two years...". After I reviewed the code this is not a bug, but a feature instead, there's nothing I could find about selecting a range in years.

akattow commented 2 years ago

@shreekeshmurkar what we're seeing is that although we can get range selection to function with a Year picker, the class names aren't being applied, so it's impossible to style in-range and range-end elements

here's the behavior:

YearRange_Bug

and here is (roughly) the code:

  <ReactDatePicker
          ref={ref}
          showYearPicker={showYearPicker}
          locale={locale}
          inline={inline}
          selected={selected}
          selectsRange={selectsRange}
          onChange={onChange}
          {...props}
        />
emrerenJs commented 1 year ago

any solvings for this issue?

github-actions[bot] commented 4 months ago

This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 10 days.