Cannot initialize Calendar Value when attached to input

I’ve just upgraded from 2.6 to 3.5 and you can no longer initialize a calendar value that is attached to a form field. However, if I attach the calendar to a div it initializes just fine.


<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
<meta name="keywords" content="">
<meta name="description" content="">
	<script src="../../dhtmlxCalendar/codebase/dhtmlxcalendar.js"></script>
	  		<td class="small_text">Hire Date:</td>
				<div id="calendar_here"></div>
				<td><input type="text" id="employee_hire_date" style="width: 100px;" readonly="true" onfocus=""></td>

Well it appears you can initialize the value by setting the value of the attached form field:

The trouble with this is that in 2.6 you could set the value of a calendar using a js time object like this:



And have the calendar object keep track of the time without actually displaying the time on the popup calendar. It doesn’t appear that this isn’t possible any longer for two reasons. First, you cannot set the value of a calendar attached to an input field directly, secondly, you can’t set the time without actually displaying the time.

Can this be resolved or can the functionality of the old version calendar be put back in place?

To reproduce your isue we need completed demo. … leted_demo

I know this is an old one but I know why this happens.

The calendar is indeed initialised to the custom date but, when the user clicks into the text input setDate is called again on the calendar.
This time it looks for the value of the input (which is blank) so the calendar defaults back to a new Date object.