mithril-datepicker
mithril-datepicker copied to clipboard
API for disabling past dates and intervals user can select
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: ...
})
@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?
indeed, it's way easier this way