Hello I have a problem with the data picker form jQuery. The following code ignores the mindate
$('#datefrom').datepicker({
minDate: '26.04.2013',
setDate: +0,
dateFormat: 'dd.mm.yy',
onSelect: function(dateStr) {
var date = $(this).datepicker('getDate');
if (date) {
date.setDate(date.getDate() + 1);
}
$('#dateto').datepicker("setDate", date);
}
});
$('#dateto').datepicker({
minDate: '27.04.2013',
setDate: +0,
dateFormat: 'dd.mm.yy'
});
$("#datefrom").datepicker().change(function() {
var date = $(this).datepicker('getDate');
if (date) {
date.setDate(date.getDate() + 1);
}
$('#dateto').datepicker("setDate", date);
});
$("#datefrom").datepicker('setDate', 'today');
$("#dateto").datepicker('setDate', +1);
To do have any idea what i could do?
minDate wants a Date-object http://api.jqueryui.com/datepicker/#option-minDate
$( ".selector" ).datepicker({ minDate: new Date(2007, 1 - 1, 1) });
this works for me: http://jsfiddle.net/JVueL/