Hacker0x01 / react-datepicker

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

Add multiple months visual selection #4944

Closed luistorres closed 3 days ago

luistorres commented 3 days ago

Description

Currently there's a selectsMultiple flag that enables the pick of multiple dates, yet the selection styles for when applied together with showMonthYearPicker was never implemented.

Problem Current behaviour upon selecting multiple months:

Screenshot 2024-06-28 at 08 54 03

Changes This is a simple change that adds the missing selected class (react-datepicker__month-text--selected) to the scenario of having selectsMultiple & showMonthYearPicker flags enabled

Screenshot 2024-06-28 at 08 44 37

Screenshots

To reviewers

Contribution checklist

codecov[bot] commented 3 days ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 96.67%. Comparing base (49299d5) to head (d82aa0c).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #4944 +/- ## ========================================== + Coverage 96.66% 96.67% +0.01% ========================================== Files 28 28 Lines 3264 3275 +11 Branches 1355 1357 +2 ========================================== + Hits 3155 3166 +11 Misses 109 109 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

martijnrusschen commented 3 days ago

This PR is lacking test coverage. Can you add that to ensure this won't break in the future?

luistorres commented 3 days ago

This PR is lacking test coverage. Can you add that to ensure this won't break in the future?

Yes, on it 👍

luistorres commented 3 days ago

@martijnrusschen should be fine now 😃

martijnrusschen commented 3 days ago

Perfect!