c# - Telerik UI for MVC => DateTime bug -
i working telerik (kendo) ui asp.net mvc , using grid. problem have bug datetime type. here source:
this part model:
public class discussion { [datatype(datatype.date)] [displayformat(applyformatineditmode = true, dataformatstring = "{0:mm/dd/yyyy}")] public datetime date { get; set; } // more code... }
this editor template(which comes telerik ui)
@model datetime? <div style="background-color: red; color: aqua; font-size: 28px;"> @(html.kendo().datepickerfor(m => m) .format("mm/dd/yyyy")) </div>
and in view (in grid) date property:
columns.bound(model => model.date).width(150).format("{0:mm/dd/yyyy}");
the problem after create new element => http://prntscr.com/8iq7si in controller receive date value: {1.1.0001 г. 0:00:00} => http://prntscr.com/8iq8eq
in rare cases date send, there bug format , modelstate never valid.
p.s here generated html:
<input data-val="true" data-val-date="the field date must date." data-val-required="the date field required." id="date" name="date" type="text" value="01.01.0001" data-role="datepicker" class="k-input" role="combobox" aria-expanded="false" aria-owns="date_dateview" aria-disabled="false" aria-readonly="false" data-bind="value:date" style="width: 100%;">
Comments
Post a Comment