I am using piackadate.js as a date picker for my site. I would like to implement the functionality that would disable any previous date. I read the docs on disabling dates but I don't see a way to disable all previous dates.
How would one do this?
I am using piackadate.js as a date picker for my site. I would like to implement the functionality that would disable any previous date. I read the docs on disabling dates but I don't see a way to disable all previous dates.
How would one do this?
You can do it much easier. It will disable all the previous dates.
$('#test').pickadate({
min: true
});
Try this:
var yesterday = new Date((new Date()).valueOf()-1000*60*60*24);
$('#test').pickadate({
disable: [
{ from: [0,0,0], to: yesterday }
]
});
1000*60*60*24
is the number of milliseconds in a day.