datepicker icon indicating copy to clipboard operation
datepicker copied to clipboard

Bug: exclude.date blocks same date across all years

Open sajermann opened this issue 11 months ago • 0 comments

Hi, I've found a bug when using the exclude.date property. When trying to exclude a specific date, the library is blocking the same date across all years, even when providing a complete date with year specification.

Steps to reproduce

const props = useDatePicker({
  selectedDates,
  onDatesChange,
  calendar: {
    startDay: 1,
  },
  exclude: {
    date: [new Date(2025, 1, 20)], // or simply new Date()
  },
});

Codesandbox

Reproduce Exemple

Expected behavior

The date should only be blocked for the specified year (2025).

Current behavior

The date (February 20th) is being blocked for all years when navigating through the calendar.

I've tried different approaches like:

  1. Using new Date()

  2. Explicitly setting the date with new Date(2025, 1, 20)

But the issue persists. The date continues to be blocked across all years.

Environment

  • @rehookify/datepicker version: 6.6.8

  • React version: 19.0.0

Let me know if you need any additional information. Thank you!

sajermann avatar Feb 21 '25 00:02 sajermann