--- pub/TWiki/JSCalendarContrib/calendar-setup.js 2011-08-21 05:03:29.000000000 +0100 +++ pub/TWiki/JSCalendarContrib/calendar-setup-initial-datetime_mod.js 2012-12-12 16:39:38.000000000 +0000 @@ -1,3 +1,5 @@ +// Modified version of calendar-setup.js to prevent intial date+time supplied to calendar via Calendar.setup({date: XXX}) from being replaced with the current date+time, T.Crane, Wed Dec 12 16:16:08 GMT 2012. + /* Copyright Mihai Bazon, 2002, 2003 | http://dynarch.com/mishoo/ * --------------------------------------------------------------------------- * @@ -155,7 +157,11 @@ var dateFmt = params.inputField ? params.ifFormat : params.daFormat; var mustCreate = false; var cal = window.calendar; - if (dateEl) + // Only update the initial date+time to supply to the calendar (params.date) if; + // (1) the input TWiki form field is empty [eg. first time use] OR + // (2) no initial date+time was supplied to by the Calendar.setup({date: XXX}) setup function. + // T.Crane, Wed Dec 12 16:37:11 GMT 2012. + if (dateEl && (params.inputField.value.length > 0 || params.date == null)) params.date = Date.parseDate(dateEl.value || dateEl.innerHTML, dateFmt); if (!(cal && params.cache)) { window.calendar = cal = new Calendar(params.firstDay,