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

DateTime Value setter not working when Date Kind is Local

1 Answer 27 Views
Date/Time Pickers
This is a migrated thread and some comments may be shown as answers.
Sergi
Top achievements
Rank 1
Sergi asked on 12 Aug 2013, 10:26 AM
Hello.

I'm using the Datepicker, but it will not work when the Date has a Kind of type Local.

It renders as :

<input data-val="true" data-val-date="The field FechaInicio must be a date." data-val-required="El campo FechaInicio es obligatorio." id="FechaInicio" name="FechaInicio" type="date" value="2013-07-20T15:00:00.000Z" />

Instead of the proper way which works that is :

<input data-val="true" data-val-date="The field FechaInicio must be a date." data-val-required="El campo FechaInicio es obligatorio." id="FechaInicio" name="FechaInicio" type="date" value="15/07/2013" />
I'm using the Kendo UI MVC Wrapper, and I'm getting this weird behaviour when posting the date to the controller from javascript with:
date.toISOString()

1 Answer, 1 is accepted

Sort by
0
Kiril Nikolov
Telerik team
answered on 13 Aug 2013, 03:00 PM
Hello Sergi,

Using the toISOstring() returns the date formatted using ISO 8601 specification, which uses the following  format - YYYY-MM-DDTHH:mm:ss.sssZ. If you want to return your data in a different format, please take a look at this section of the documentation showing how to format dates using Kendo UI:

http://docs.kendoui.com/getting-started/framework/globalization/dateformatting
 
Regards,
Kiril Nikolov
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
Sergi
Top achievements
Rank 1
Answers by
Kiril Nikolov
Telerik team
Share this question
or