Charles Marsh
Charles Marsh

Reputation: 465

jQuery Datepicker - Settings help

I am using the jQuery Datepicker plugin and I'm having trouble righting out this unique rule.

I need a rule that validates if after 12:00pm disable today

This should be validated on the current AEST time.

Would it be easier to add jquery validate and use that for the validation instead?

Upvotes: 1

Views: 648

Answers (1)

dqhendricks
dqhendricks

Reputation: 19251

// get today's date
var myDate = new Date();
// add one day
myDate.setDate(myDate.getDate()+1);

// bind datepicker to element while using the minDate option
$('.selector').datepicker({
    minDate: myDate
});

This will set the date picker range to any day after today's date. You should still validate client and server side however.

If this is what you are looking for, please select the check mark next to this answer. Thanks!

Upvotes: 2

Related Questions