How do i disable past dates in the datepicker?
Hello, this issue has been closed because it does not conform to our issue requirements. Please submit issues with issue-generator. More info can be found in #3693.
hi,you can add disabledDate
function in pickerOptions
pickerOptions: {
disabledDate(time) {
return time.getTime() < Date.now() - 8.64e7;
}
}
@jyjunyz It was a helpful comment. For those who didn't get what's "8.64e7", it's just the number of milliseconds of a day. We need to subtract the number from current timestamp so that we don't disable "today".
@jyjunyz Thanks a lot for the comment. It saved me a lot of time.
@jyjunyz Thanks, this worked like a charm.
and thanks from @authlab-frontdev to explain what 8.64e7 mean.
Most helpful comment
hi,you can add
disabledDate
function in pickerOptions