Set date from client

Is possibile set a value to dhtmlx calendar from client ?
The method setDate, set the correct value in the calendar widget but the attached input don’t refresh; i’m using a dhtmlx form and i don’t know the attached input (id) because the code is autogenerated.
js object about form (not complete) : [
{ type: “settings”, position: “label-left”, labelWidth: “auto”, inputWidth: “auto”},
{ type: “calendar” , name:“calTo”, label:“A”, dateFormat:“%Y-%m-%d”, required: true, validate:“NotEmpty”, enableTime:false, readonly:true, inputWidth:120 }

Any tricks or tips ?

On other problem is that enableTime attribute don’t work and i have to get the calendar widget and call .hideTime();


Resolved first question:
var d = new Date();

work -> update component and input

About the second question (enableTime) ?

Tested with your code snippets - all right.

We need to see your completed demop to reproduce your issue … leted_demo

My demo
Complete Demo.rar (529 KB)

Please try to use attached library instead of the original. We have fixed the problem in it.

If you are using dhtmlx.js in your app, you may generate the library using libCompiler in Suite package. You need to replace the existing dhtmlxCalendar/codebase/dhtmlxcalendar.js and run libCompiler. (11.3 KB)

About first question setItemValue(), this function not work properly.

var d = new Date();
form.setItemValue(“cal_from”, d);
form.send(‘url’,“post”,function(loader, response) { … }

The form send the old date value (“cal_from”).
Sometimes work and sometimes not work. Can i force ? Are there any function (for form component) to force ?

New problem:


dhtmlXCalendarObject.prototype.langData[“de”] = {
dateformat: ‘%Y.%m.%d’, …

Label of days, months, … work but dateFormat isn’t update.

My issue about setItemValue is solved (it was a problem about setSensitiveRange).

Any news about dateFormat (i18n file) ?

My demo…
“fi” dateFormat is “%Y.%m.%d” but the dateFormat is “%d.%m.%Y”.
Complete Demo.rar (529 KB)

Any news ?


please use dhtmlxcalendar.js from attached demo
just include it right after dhtmlx.js
demoupdated.rar (492 KB)

Ok, it’s work but there is a new issue.
Whenever set a value from client side (form.setItemValue(name, value)), the date format change.
Attached my demo.
demoupdated_2.rar (493 KB)

Any news ?


Please put uncopressed files into demo (at least for dhtmlXForm)

no worries, I fugured it out
updated files in demo: dhtmlxform.js, dhtmlxform_item_calendar.js
fixed.rar (509 KB)