Hi. I created a calendar with Datepicker, but recently I'm having some trouble with it. The default date is always selected during months. I.e. today is Sep 15th, when I navigate to other months, the 15th day of that month is select as well (as if it's the defaultDate).
As they say, "A picture is worth a thousand words":
http://img405.imageshack.us/img405/6348/calendarmo.png
Translation: Outubro -> October, Novembro -> November, ... Dom -> Sunday, Seg -> Monday, ...
That's my code for this datePicker:
$("#datepicker").datepicker({
//Espaço de tempo para reserva de horário
minDate:'0',
maxDate: '31/12/2010',
defaultDate: null,
//Controle de acesso
beforeShowDay: verificaData,
onSelect: retornaTexto
});
This is an auxiliary function that I use:
function verificaData(date) {
if (date.getDay() != 0) {
for (var i = 0; i < datasDisponiveis.length; i++) {
if (date.toString() == new Date(datasDisponiveis[i]).toString()) {
return [true,''];
}
}
return [false,''];
}
return [false,''];
}
Basicaly it verify an array checking if the date is currently available.
That's about it. I can't see where the error is, can you guys help me?
Thanks in advance!
EDIT:
I think I'm using the latest Datepicker version, this are my includes:
<script src="http://code.jquery.com/jquery-latest.js"></script>
<script src="jquery.min.js"></script>
<script src="jquery-ui.min.js"></script>
<script type="text/javascript" src="jquery.ui.datepicker-pt-BR.js"></script>
<script type="text/javascript" src="http://dev.jquery.com/view/trunk/plugins/validate/jquery.validate.js"></script>
<link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/>