date format

Hi,

I use the calendar in dhtmlxform. It can save the the date in database, but the date format is “Fri Dec 7 17:22:00 UTC+0800 2012”. How can just save the date format “07-Dec-2012”.

thank you.
Kenneth

Hi
Here is code sample for you:

formData = [ {type: "calendar", dateFormat: "%d.%m.%Y", serverDateFormat: "%Y-%m-%d", name: "start_date", label: "Calendar Start", readonly: true, value:"2012-03-20", calendarPosition: "right"} ]; //debugger; myForm = new dhtmlXForm("myForm", formData); //myForm.setFormData({"start_date": "2012-03-20"});

Hi,

thank you for your reply. I would like to have the date format “07-Dec-2012” to save into database , not this format “Fri Dec 7 17:22:00 UTC+0800 2012”. It may be the date format problem. I don’t know the problem to appear my computer setting, database setting or the code.

Could you give me the suggestion again.
thank you

Kenneth

Hi
It was a sample. Set your date format this way:

dateFormat: "%d-%M-%Y"

Hi,

The problem can’t solve. I attach the demo and problem screen for your reference.

thank you again.
Kenneth
DEMO.ZIP (901 KB)

Hi

dhtmlxform.js, line 2507:

dhtmlXForm.prototype.send = function(url, mode, callback){

var formdata = this.getFormData();

change to

var formdata = this.getFormData(true);

also you can down latest form version from our site

thank you.
send() is ok. But save() not ok.

please gave me once again.

myForm.save() is a part of datastore, it will not work w/o it

Hi,

How can I solve this problem, could you gave me the idea.

thank you.

decide - use form and send() w/o datastore or save() with datastore (in this case datastore will operate with requests), depending on app struct - use one of them. if you have only form and database imho 1st case, if you have grid and form which is binded to it - 2nd

hi,

It may be the 2nd case. I have a form to input the data into database. the field of database is text. I try the field of setting that is date, input the data can’t save into database, so I set the field is text.
Finally, get the data from database and read the data in the grid, but it saved the data is “Fri Dec 7 17:22:00 UTC+0800 2012”. It isn’t 07-Dec-2012.

I don’t know what problem is. Could you gave the suggestion again.
thank you.

HI,

In client side:

{type: "calendar", name: "podatet", label: "PO Date To", value: "", dateFormat: "%d-%m-%Y", calendarPosition: "right","skin":"omega",inputWidth:200}, 

In sever side:
Fri Dec 21 09:40:00 UTC+0800 2012

but I want d/m/yyyy, why it comes like this even I formatted?

Could you help to me. I can’t solve this , need your help.
thank you.

Hello,

In sever side: Fri Dec 21 09:40:00 UTC+0800 2012

Please download the latest version of Suite package and try with it. save() and send() methods return correct result with the latest form.

hi,

thank you for your reply. where to download?

Hi,

here is the link
dhtmlx.com/x/download/regula … xSuite.zip