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

YearPicker when selecting range doesn't apply classnames correctly

Open javsand opened this issue 3 years ago • 5 comments

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

javsand avatar Jun 10 '22 11:06 javsand

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

shreekeshmurkar avatar Jun 10 '22 13:06 shreekeshmurkar

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.

javsand avatar Jun 13 '22 12:06 javsand

@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}
        />

akattow avatar Jul 11 '22 13:07 akattow

any solvings for this issue?

emrerenJs avatar Dec 06 '22 22:12 emrerenJs