Skip to content

Bug: exclude.date blocks same date across all years #76

@sajermann

Description

@sajermann

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions