Salve a tutti. Non sto riuscendo a capire come impostare l'oggetto date() su una determinata data da me scelta. Mi spiego meglio:
in una mia applicazione PHP utilizzo un calendario JS che, tra i parametri, prevede un oggetto Date() per preimpostare la data selezionata di default. Le date che utilizzo sono memorizzate in formato MySQL DATETIME, ma posso manipolarle come voglio.
Ecco qui la porzione di codice con cui il calendario viene richiamato:
codice:
Calendar.setup({
inputField : "data_esame", // id of the input field
ifFormat : "%Y-%m-%d %H:%M:00", // format of the input field (even if hidden, this format will be honored)
displayArea : "vis_data_esame", // ID of the span where the date is to be shown
daFormat : "%A %d %B %Y ore %H:%M",// format of the displayed date
align : "Bc", // alignment (defaults to "Bl")
weekNumbers : false, // disabilito i numeri di settimana
range : [2007,2008],
showsTime : true,
timeFormat : "24",
step : "1",
date : ,
dateStatusFunc : function (date) { // disable weekend days (Saturdays == 6 and Subdays == 0)
return (date.getDay() == 0) ? true : false;
}
});
Nel parametro "date", attualmente vuoto, andrebbe la data da preimpostare, come da istruzioni:
Type: date;
This allows you to setup an initial date where the
calendar will be positioned to. If absent then the
calendar will open to the today date.
Grazie a tutti, aspetto fiducioso!