This is a migrated thread and some comments may be shown as answers.

Date picker control posts date in display format back to the server

1 Answer 62 Views
Date/Time Pickers
This is a migrated thread and some comments may be shown as answers.
Darren
Top achievements
Rank 1
Darren asked on 17 Dec 2013, 08:55 PM
The date picker control posts the date in display format back to the server. This causes issue with date parsing if the display format is not what is expected (i.e. configured) on the server.

I have attached an example project which reproduces the issue. The date format is set to dd/MM/yyyy. The example posts 8th December 2013 back to the server in in the display format as 08/12/2013 which is then misparsed as 12th August 2013 on the server.

1 Answer, 1 is accepted

Sort by
0
Alexander Popov
Telerik team
answered on 19 Dec 2013, 08:49 AM
Hello Darren,

Thank you for the provided project. This behavior is expected in cases where the data is sent via form submission. Basically when the form is submitted the browser is not sending the DatePicker value, but rather the value of input HTML element used for initializing it. In the current scenario I would recommend passing the data using Ajax request - this will allow you to get the value of the DatePicker's as a JavaScript Date object.

Regards,
Alexander Popov
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
Date/Time Pickers
Asked by
Darren
Top achievements
Rank 1
Answers by
Alexander Popov
Telerik team
Share this question
or