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

Datepicker shows no initial value

7 Answers 1294 Views
Date/Time Pickers
This is a migrated thread and some comments may be shown as answers.
Alan Mosley
Top achievements
Rank 1
Alan Mosley asked on 05 Oct 2015, 03:07 AM

My dates pickers are showing no values when loaded, if I look at source I can see that they have a value, but it is not showing. you can see below that value is present.

HTML generated 

<span class="k-widget k-datepicker k-header"><span class="k-picker-wrap k-state-default"><input name="StartDate" class="k-input" id="StartDate" role="combobox" aria-disabled="false" aria-expanded="false" aria-readonly="false" aria-owns="StartDate_dateview" style="width: 100%;" type="text" value="2015/09/05" data-role="datepicker" data-val-required="The StartDate field is required." data-val="true" data-val-date="The field StartDate must be a date."><span class="k-select" role="button" aria-controls="StartDate_dateview" unselectable="on"><span class="k-icon k-i-calendar" unselectable="on">select</span></span></span></span>

 

 MVC config

@Html.Kendo().DatePickerFor(Function(m) m).Format("yyyy/MM/dd").ParseFormats({"dd-MM-yyyy", "dd/MM/yyyy", "MM/dd/yyyy", "yyyy/MM/dd", "yyyy-MM-dd"}).Value(Model)

Thanks

7 Answers, 1 is accepted

Sort by
0
Dimo
Telerik team
answered on 07 Oct 2015, 06:10 AM
Hello Alan,

The described behavior may be observed in the Edge browser with specific cultures (formats). We have already fixed this, please upgrade Kendo UI to Q2 2015 SP2 or Q3 2015.

http://www.telerik.com/support/whats-new/aspnet-mvc/release-history/ui-for-asp-net-mvc-q2-2015-sp2

Regards,
Dimo
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Gary Davis
Top achievements
Rank 2
answered on 08 Jan 2016, 09:24 PM

I have this problem in Edge using the current Kendo 2015.3.1111.
Generated (note type="date" which is different than example above which is "text"):

<input data-val="true" data-val-date="The field Birth Date must be a date." id="BirthDate" name="BirthDate" type="date" value="04/06/1950" />

MVC

<p>$('#BirthDate').kendoDatePicker();</p>

In Edge, the field is blank, even if emulation is changed to IE11. Run this in real IE11, Chrome or Firefox and it works as expected.

Remove type="date" and it works in Edge. 

This is a jsFiddle you can try in Edge then IE11: https://jsfiddle.net/gardavis/u3pyo66n/

Thanks,

Gary

 

 

 

 

 

 

0
Dimo
Telerik team
answered on 11 Jan 2016, 06:06 PM
Hi Gary,

MS Edge accepts date values only in "yyyy-MM-dd" format. If you remove the DatePicker initialization statement in your demo, the textbox value will still be cleared by the browser. That's why, please use type="text". If you are using the DatePicker MVC wrapper in your actual application, then make sure you have correctly upgraded the Kendo UI MVC assembly.

Regards,
Dimo
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Gary Davis
Top achievements
Rank 2
answered on 11 Jan 2016, 06:50 PM

In the jsFiddle demo, I changed the initialization to be value="1950-04-06" but it still failed to initialize the control. In any case, I do not pass the value as a string but as a DateTime object and the control generates the date as a string in the value attribute. 

I can't change the input element type="date" to type="text" since the element is generated by the Kendo control.

And yes, when Kendo is updated in the project, the css, js and wrapper dll are all updated.

Thanks for looking at this Dimo but I am still looking for a resolution, ideally a fixed Kendo build.

 
0
Dimo
Telerik team
answered on 13 Jan 2016, 03:41 PM
Hi Gary,

>> "I can't change the input element type="date" to type="text" since the element is generated by the Kendo control."

The input type depends on the Kendo.Mvc.dll version. If "date" type is rendered, this indicates that the Kendo.Mvc.dll is version is older than 2015.2.902, which is the first version to resolve the problem. Please double-check.

Regards,
Dimo
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Gary Davis
Top achievements
Rank 2
answered on 13 Jan 2016, 03:56 PM

Thanks. I will upgrade the dll from what I currently have (2015.2.729) to the current version (2016.1.112) and try again.

 

Gary

0
Gary Davis
Top achievements
Rank 2
answered on 13 Jan 2016, 06:50 PM

After upgrading the project to the 2016 Q1 MVC Kendo, the DatePicker problem is resolved.

Thanks again,

Gary

Tags
Date/Time Pickers
Asked by
Alan Mosley
Top achievements
Rank 1
Answers by
Dimo
Telerik team
Gary Davis
Top achievements
Rank 2
Share this question
or