1

I'm using Kendo with asp.net mvc

@Html.EditorFor(model => model.shipmentDate)

It shows blank value in Chrome v56 and that wasn't the case with Chrome v49.0.2623 for example.

Here's the ViewModel:

[Display(Name = "Shipment Date")]
[Required(ErrorMessage = "Please select a shipment date")]
[DataType(DataType.Date)]
[DisplayFormat(DataFormatString = "{0:yyyy-MM-dd}", ApplyFormatInEditMode = true)]
public DateTime shipmentDate { get; set; }

Also, inspect this element with Chrome's Developer tool I have this:

<input data-val="true" data-val-date="The field Shipment Date must be a date." data-val-required="Please select a shipment date" id="shipmentDate" name="shipmentDate" type="text" value="03/09/17" data-role="datepicker" class="k-input" role="combobox" aria-expanded="false" aria-owns="shipmentDate_dateview" style="width: 100%;">

The value is passed from the Controller as you can see, but date does not display.

What should I change with this version of Chrome?

joegreentea
  • 325
  • 3
  • 12
  • 1
    http://stackoverflow.com/questions/41945417/kendo-ui-datepicker-incompatible-with-chrome-56, http://stackoverflow.com/questions/42082886/kendo-datepickerfor-issue-in-chrome-version-56-0-2924, http://www.telerik.com/forums/datepicker-and-currencytextbox-stopped-working-in-chrome-56 – The Dread Pirate Stephen Mar 10 '17 at 13:24

1 Answers1

0

This is a known issue per Telerik: http://www.telerik.com/forums/kendo-ui-date-blank-in-chrome-56-0-2924

You can either update the Kendo.Mvc.dll to latest version e.g. Kendo 2017.2.621

or add HtmlAttributes type = "text" as a workaround:

@(Html.Kendo().DatePicker().Name("Date")
     .Value(Model.date)
     .HtmlAttributes(new { type = "text" })
)

or change the @Html.EditorFor to @Html.Kendo().DatePicker() with this version of chrome compatible formatting ("yyyy-MM-dd") as such:

@(Html.Kendo().DatePicker().Name("Date")
     .Value(Model.date)
     .Format("yyyy-MM-dd")
)
joegreentea
  • 325
  • 3
  • 12