This is a migrated thread and some comments may be shown as answers.
DatePickerFor stopped working with latest update
2 Answers 18 Views
This is a migrated thread and some comments may be shown as answers.
Bryan
Top achievements
Rank 1
Bryan asked on 17 Nov 2014, 03:03 AM
I've been developing an app for some time now using the Kendo UI MVC wrappers. I just updated my Telerik components with version 2014.2.1008 this weekend. All of a sudden, the DatePickerFor is not working correctly for nullable DateTime values where it had been working before. Instead of a non-null date value being displayed, I see something like {0:17} in the edit box and it won't validate.

Assuming my model has a property like this:

     public DateTime? DueDate { get; set; }

The following .cshtml markup produces the erroneous result:

    @Html.Kendo().DatePickerFor(model => model.DueDate)

The following .cshtml markup produces the correct result, but I can't use it because the value may be null:

    @Html.Kendo().DatePickerFor(model => model.DueDate.Value)

I can't deploy other code I've been working on tonight because of this problem. I need a resolution to this ASAP.

2 Answers, 1 is accepted

Sort by
0
James
Top achievements
Rank 1
answered on 17 Nov 2014, 05:22 PM
I am having the same issue.  Please update with a resolution.
0
Bryan
Top achievements
Rank 1
answered on 17 Nov 2014, 05:27 PM
I got this support ticket reply from Telerik:

Hello Bryan,This is a known bug, which slipped out in the service pack release. We introduced a feature that sets the Model DataFormatString value to the widget format value automatically. However, the format is not set correctly. The problem can be overcome using the Format method of the wrapperThe bug is addressed in the last internal build. The next official release is due the mid of this week.Regards,
Georgi Krustev
Telerik
Asked by
Bryan
Top achievements
Rank 1
Answers by
James
Top achievements
Rank 1
Bryan
Top achievements
Rank 1
Share this question
or