剑道甘特(MVC)是解析美国的日历日期(我在英国!) [英] Kendo Gantt (MVC) is parsing dates on US calendar (I'm in the UK!)

查看:167
本文介绍了剑道甘特(MVC)是解析美国的日历日期(我在英国!)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在英国和正在使用MVC剑道甘特图如下:

I'm in the UK and am using a Kendo MVC Gantt chart as follows:

  @(Html.Kendo().Gantt(Of IMS2_App.JobTasksVM, IMS2_App.Models.Dependency)().Name("gantt") _
.Columns(Sub(columns)
                 columns.Bound("id").Title("id").Width(20)
                 columns.Bound("title").Title("Task").Width(200).Editable(False)
                 columns.Bound("start").Title("Start Date").Format("{0:dd MMM yyyy}").Width(90).Editable(True)
                 columns.Bound("end").Title("End Date").Format("{0:dd MMM yyyy}").Width(90).Editable(True)
         End Sub) _
    .Views(Sub(views)
                   views.DayView()
                   views.WeekView(Function(yearView) yearView.Selected(True))
                   views.MonthView()
                   views.YearView()
           End Sub) _
  .DataSource(Function(d) d.Read(Function(read) read.Action("ReadTasks", "Job", New With {.id = Model})).Model(Sub(m)
                                                                                                                       m.Id(Function(f) f.id)
                                                                                                                       m.ParentId(Function(f) f.ParentID)
                                                                                                                       m.OrderId(Function(f) f.OrderID)
                                                                                                                       m.Field(Function(f) f.Expanded)
                                                                                                               End Sub).Update(Function(u) u.Action("UpdateTask", "Job")) )) 

直到我尝试通过AJAX后更新数据库中的所有工作正常。发布更新时,我datepickers正确的基础上的基础数据是英国为中心的方式工作,但日期似乎对美国的日历进行验证(即MM / DD / YYYY)和日期是根据美国之间的$ P $返回ptation。

All is working fine until I attempt to update the database via the AJAX post. My datepickers are correctly working in a UK-centric way based on the underlying data, however when posting updates the dates seem to be validated against US calendar (ie MM/dd/YYYY) and the dates are returned under a US interpretation.

我看到这个问题已经注意到了的DatePicker小部件<一个href=\"http://stackoverflow.com/questions/11625237/kendo-datepicker-fails-validation-for-custom-date-format\">here但我不知道如何在甘特HTML帮助解决这个问题。

I see this issue has been noted for the DatePicker widget here but I don't know how to fix this issue in the Gantt HTML Helper.

任何想法?

推荐答案

我把这个问题Telerik的支持,他们叫我去的 http://docs.telerik.com/kendo-ui/aspnet-mvc/globalization 。我的重要疏忽是在_Layout.vbhtml以下内容:

I put this issue to Telerik support and they referred me to http://docs.telerik.com/kendo-ui/aspnet-mvc/globalization. My crucial omission was the following in the _Layout.vbhtml:

<script>
    kendo.culture("en-GB");
</script>

在包括(连同我的JS捆绑相应的文化文件)的问题得到解决。

Once included (together with the appropriate culture file in my JS bundle) the problem was solved.

这篇关于剑道甘特(MVC)是解析美国的日历日期(我在英国!)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆