Save uk format date from calendar

I have a form with a couple of calendar controls and data loaded from MySQL.

The source filed in MySQL is of type DATE. In myphpadmin that dates always show as “YYYY-MM-DD”

I used dateFormat: “%d-%m-%Y” to show the date in the form in UK format.
When I save the form it always get saved in MySQL as 0000-00-00.

Is this how the form/calendar is supposed to work?
If not, is there a simple way to convert value in the control from UK to US format?

Thanks,
Paul

See the attached sample.
There is a way to use similar properties you need.
There are 2 Calendars. The second one gets date from the first one in DD-MM-YYYY format and displays in YYYY-DD-MM
calendar_changeFormat.rar (83.3 KB)

thanks Darya,

I have downloaded your sample and I can see what you are doing.
However, my problem is when I try to save the data back to the database it always gets reset to 0000-00-00

I am using PHP and MySQL; I added -
$conn->event->attach(“beforeUpdate”,myUpdate);
to my PHP script so I could see what gets returned to the database. It is the long text date format eg -
Wed Oct 20 2010 00:00:00 GMT+0100 (GMT Daylight Time)

I am using a DATE field type in MYSQL and I just want to save “2010-10-20”

I now realise that I can not get my form to save any dates - UK format or otherwise…

I have changed the form field type from calendar to input and now I can save dates - provided input it correctly as “yyyy-mm-dd”.

I still want to use the calendar control as it looks so much better.

I made one more demo tangent to your issue. Please, see it.
Suppose, it will help you more.
calendar_serverFormat.rar (49.5 KB)

this issue turns out to be the same as another one…

viewtopic.php?f=7&t=22792