material-datetime-picker
material-datetime-picker copied to clipboard
Max and min allowed dates support
This pull request add possibility to specify min and max allowed dates (including also time) for selection using options or setters.
Thanks for the contribution!
I'm short on reviewing time at the moment. To help me get started quickly can you describe the change in more detail - what exactly do the startDate and stopDate options do? How can I check they are working correctly?
Can you add some tests ? Test coverage is low so far but I would like to raise it, starting with new features like this.
Thanks!
Hello. Sorry for such short description.
These options deny users to select date earlier than startDate and later than stopDate. So if you specify these options, all UI controls (day, hour and minute pickers) which allow to select date not from specified interval will be disabled. You can set only one of the options. Setters are implemented for on-the-fly timepicker updates, for example if a user is denied to select a time greater than current but timepicker stays opened for a few minutes, stopDate can be updated to allow next five minutes or new hour selection and UI will be also updated.
Regarding tests, I'll try to write them (I've never done it before :) ), but I can't promise that since I'm currently busy.