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

2 posts, 0 answers
  1. Darren
    Darren avatar
    1 posts
    Member since:
    Nov 2013

    Posted 17 Dec 2013 Link to this post

    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.

  2. Alexander Popov
    Admin
    Alexander Popov avatar
    1416 posts

    Posted 19 Dec 2013 Link to this post

    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!
  3. UI for ASP.NET MVC is VS 2017 Ready
Back to Top