Reputation: 421
I have added a jQuery date picker into my site but do not want anyone to be able to select a date before 1st June 2014. With the code I have it is fine but it changes every day! The datepicker has been on my site now for 9 days and I set it to 1st June 2014, problem is as each day passes the calender changes. Currently I am able to only select from 10th June! I think this must be because of the minDate setting but how do i stop this from changing every day? Thank you for any help.
Code as follows:
<script type="text/javascript">
$(document).ready(function() {
$("#datepicker").datepicker({minDate: 129, maxDate: "+5Y", changeMonth: true,changeYear: true, showButtonPanel: true, dateFormat: 'dd MM yy'});
});
$('#form').on('submit', function(){
return $('#email').val() == $('#emailConfirmation').val();
});
</script>
Upvotes: 0
Views: 175
Reputation: 1022
$(function () {
$("#datepicker").datepicker({
minDate: new Date(2014, 5, 1)
});
});
Upvotes: 1