Hey,
is it a bug in jQuery UI? When I call .datepicker('setDate', date);
and date
is a date-object with time, datepicker set the time of date
to 0:00?
And if I clone the variable..
var datewithtime = new Date();
var lTmpDate = datewithtime;
$('#Modal_KalendarTermin #DP_DatumVon').datepicker("setDate", lTmpDate);
.. datewithtime
is just the same (without time - only date with time = 0:00).
I found a third parameter "noChange" in the jquery-ui.js -> serach for "_setDate: function
". For what?
Excerpt from jquery-ui.js
/* Set the date(s) directly. */
_setDate: function(inst, date, noChange) {
var clear = !(date);
var origMonth = inst.selectedMonth;
var origYear = inst.selectedYear;
date = this._restrictMinMax(inst, this._determineDate(inst, date, new Date()));
inst.selectedDay = inst.currentDay = date.getDate();
inst.drawMonth = inst.selectedMonth = inst.currentMonth = date.getMonth();
inst.drawYear = inst.selectedYear = inst.currentYear = date.getFullYear();
if ((origMonth != inst.selectedMonth || origYear != inst.selectedYear) && !noChange)
this._notifyChange(inst);
this._adjustInstDate(inst);
if (inst.input) {
inst.input.val(clear ? '' : this._formatDate(inst));
}
},
Thanks for your answers and sorry for my bad english!