refinedguides / custom-datepicker

Building a Custom Date Picker with Javascript
https://refinedguides.com/custom-datepicker/
GNU General Public License v2.0
3 stars 2 forks source link

"today" class applied incorrectly to dates from the previous or next month #2

Closed OscarGonzalez97 closed 2 months ago

OscarGonzalez97 commented 2 months ago

There is an issue with the styling of the "today" class in the datepicker. Currently, the logic does not properly filter out dates from the previous or next month, leading to the "today" class being toggled on dates that shouldn't have it.

Steps to reproduce:

  1. Navigate to the datepicker and observe the dates displayed for the current month.
  2. Check the last few days of the previous month and the first few days of the next month.
  3. Notice that the "today" class is incorrectly applied to some dates outside of the current month.

Expected behavior:

image