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

API for disabling past dates and intervals user can select #15

Open
cmnstmntmn opened this issue Aug 7, 2017 · 2 comments
Open

API for disabling past dates and intervals user can select #15

cmnstmntmn opened this issue Aug 7, 2017 · 2 comments

Comments

@cmnstmntmn
Copy link

there would be nice to restrict the user input by

  • restricting past dates
  • allowing time intervals
m(DatePicker, {
       data: ...,
       allowPastDates: true, // defaults to now
       interval: {
          start: "08/07/17", // defaults to now
          end:  "12/12/17"
       }
       onchange: ...
})
@CreaturesInUnitards
Copy link
Owner

@cmnstmntmn
Thanks! What if I just exposed a "range" prop, with optional start/end? That way, disabling the past would be :

m(DatePicker, {
  range: {
    start: "now"
  }
})

Using now for either start or end would disable either the past or the future. Otherwise, passing a date object to either one would disable the appropriate side of the timeline.

Thoughts?

@cmnstmntmn
Copy link
Author

indeed, it's way easier this way

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