Kendo UI Datepicker ModelstateError格式:“yyyy”

时间:2013-04-17 20:59:27

标签: razor datepicker kendo-ui

我在我的网络应用程序中使用了Kendo Datepicker,只是为了选择日期年份。

Everthing工作正常,直到我尝试使用提交按钮提交我的模型。我的视图调用该操作,但它发生以下ModelstateError,日期数据字段为null:

"The value '2010' is not valid for date."

问题似乎是Datepicker使用的格式。

@(Html.Kendo().DatePickerFor(model => model.date)
      .Start(CalendarView.Decade)
      .Depth(CalendarView.Decade)
      .Format("yyyy"))  // <= this is the Problem .Format("MMMM yyyy") for example works

那么,任何想法我怎么能解决这个问题?提前谢谢。

0 个答案:

没有答案