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

Binding string date value to model in angular kendo date picker

1 Answer 1433 Views
Date/Time Pickers
This is a migrated thread and some comments may be shown as answers.
Tulasinath
Top achievements
Rank 1
Tulasinath asked on 31 Aug 2014, 10:21 AM
I have an api which return the date in this format "014-08-26T15:10:45.402Z" i am using angular kendo ui .The problem i am facing is the date is not getting bound to the kendo date picker.Could someone help me out . The result is same whether I use ng-model or k-ng-model. Do we need  to convert the data in the model to date object? OR there is a much simpler way.
<input kendo-date-picker ng-model="emp.datestart" k-format="MM/dd/yyyy" />



http://dojo.telerik.com/uGIq

1 Answer, 1 is accepted

Sort by
-1
Accepted
Kiril Nikolov
Telerik team
answered on 02 Sep 2014, 11:25 AM
Hi Tulasinath,

The Kendo UI DatePicker will work with a string date value model, you just need to tell the widget in which exact format the date will be parsed. Please check the following updated example:

http://dojo.telerik.com/oWah

Regards,
Kiril Nikolov
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Noe
Top achievements
Rank 1
commented on 13 Dec 2023, 01:22 AM | edited

It , does not work, looks like kendo-datepicker does not support string as date, i need to conver my text to a new Date
Martin
Telerik team
commented on 14 Dec 2023, 03:33 PM

Hi, Noe,

It appears I am missing something from the issue. In this example you can see that the datepicker is set to the dataObject string and the date is displayed as expected. Could you please let me know what am I missing? Looking forward to your reply.

Tags
Date/Time Pickers
Asked by
Tulasinath
Top achievements
Rank 1
Answers by
Kiril Nikolov
Telerik team
Share this question
or