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}"); 
  1. 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

  2. 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

Popular posts from this blog

java - Date formats difference between yyyy-MM-dd'T'HH:mm:ss and yyyy-MM-dd'T'HH:mm:ssXXX -

c# - Get rid of xmlns attribute when adding node to existing xml -