Trying to use dhtmlxCalendar component to let user choose datetime but when the user selects a time (hour or minute) the input field does not get updated. Only selecting a date updates the input field.
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css" href="../../../codebase/dhtmlxcalendar.css"/>
</head>
<body onload="doOnLoad();">
<div style="position:relative;height:280px;">
<input type="text" id="calendar">
</div>
<script src="../../../codebase/dhtmlxcalendar.js"></script>
<script>
var myCalendar;
function doOnLoad() {
myCalendar = new dhtmlXCalendarObject("calendar");
myCalendar.setDateFormat('%d/%m/%Y %h:%i %a');
}
</script>
</body>
</html>
Darya
July 30, 2014, 12:38pm
#2
It works fine locally. We need completed demo to test your issue.
It seems like you can use any old version…
ok let me attach a demo of the issue:
http://www.webrules.gr/calendardemo/demo.html
The page also includes a screencast with the behaviour described.
Darya
July 30, 2014, 2:31pm
#4
The guide of creartion completed demo is here:
docs.dhtmlx.com/auxiliary_docs__ … pport.html
attached.
calendardemo.zip (277 KB)
Darya
July 31, 2014, 2:32pm
#6
Oh, sorry… Didn’t understand you…
Yes, it will not change: it is standard calend behaviour. Input value will change only by on DATE click.
Ken
February 6, 2015, 6:05pm
#7
You could try this:
dhxCalendar.attachEvent(“onTimeChange”, function(d){
document.getElementById(id_of_input).value = dhx4.date2str(d, this._dateFormat);
});