Reputation: 33
I have a datepicker on my website but now I want to disable days based on time. I want to achieve 2 things:
Is it possible through jquery?
Upvotes: 3
Views: 2084
Reputation: 1929
How about changing minDate according to hour of the day?
var hour = new Date().getHours();
$("element").datepicker({ minDate: hour >= 14 ? 2 : 1});
Upvotes: 3