Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option to prevent selection of dates in the past #26

Open
avh4 opened this issue Jul 29, 2017 · 2 comments
Open

Option to prevent selection of dates in the past #26

avh4 opened this issue Jul 29, 2017 · 2 comments

Comments

@avh4
Copy link
Collaborator

avh4 commented Jul 29, 2017

(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.

@abadi199
Copy link
Owner

abadi199 commented Aug 2, 2017

I think there are values in allowing users to just disable certain dates regardless they're in the future the past. One use case I can think of is if you want to black out some specific dates. So maybe we can provide these options of disabling date.

  • A range of dates (this includes before a date, or after a date, or between a date)
  • A specific list of dates.
  • Some kind of pattern/rule. (e.g: Every second Monday of every month). Not sure how the API will look like yet, but I think it's worth mentioning right now.

I think, for now, we can implement the 1st option, and then add the other options later on.

@avh4
Copy link
Collaborator Author

avh4 commented Aug 2, 2017

Sounds good-- the range is nice because it's easy to determine when/if the month/year nav buttons can be disabled. So just doing (1) for now sounds good.

Should have a PR for this later this week.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants