Skip to content

Option to prevent selection of dates in the past #26

@avh4

Description

@avh4

(Split off from #25)

We need to disable selection of dates in the past.

  • Style disabled dates differently, and remove the hover highlight and cursor: pointer
  • Prevent clicking on disabled dates
  • Prevent selection of disabled dates when typing directly in the text input (this looks like it will require some refactoring of the current code to be able to implement cleanly)
  • I think it's better to have the API a bit more generic and instead let the user optional provide an "earliest" date rather than just having a way to disallow dates in the past. (This is also in line with a future need of ours, where we'd like to limit the selection to a date range (with both a min and a max date)
  • possible future enhancement: disable the month/year back buttons when going back would go to a month that has no enabled dates in it

I have a PR in progress that mostly implements this already.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions