1
At present the js Calendar used by XoopsFormTextDateSelect and XoopsFormDateTime pops up the first time showing the date for January 2000. Subsequent popups show the correct date.
FIX:
Filename: /include/calendarjs.php
Function: function showCalendar(id)
Suggested Code:
function showCalendar(id) {
var el = xoopsGetElementById(id);
if (calendar != null) {
calendar.hide();
} else {
var cal = new Calendar(true, , selected, closeHandler);
calendar = cal;
cal.setRange(2000, 2015);
calendar.create();
}
calendar.sel = el;
calendar.parseDate(el.value);
calendar.showAtElement(el);
Calendar.addEvent(document, "mousedown", checkCalendar);
return false;
}
Explanation:
The only change is to move the parseDate() call to after the calendar has been set to point to the function's element id parameter.
The calendar's selected date is then set correctly whether the calendar is being created for first time or not.
Venezia