Kendo DatePicker文化无法正常工作 [英] Kendo DatePicker culture not working correctly

查看:84
本文介绍了Kendo DatePicker文化无法正常工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将Kendo Datepicker本地化为我的文化"is-IS",但由于某种原因,它无法正常工作.这是代码示例:

I want to localize Kendo Datepicker to my culture "is-IS" but for some reason it doesn´t work correctly. This is code example:

$("#RegisterDatePicker").kendoDatePicker({
    start: "month",
    culture: "is-IS",
    value: new Date(),
    format: "dd.MMMM yyyy",
    events: {
        change: "registerDatePicker_OnChange"
    }
});

该文化似乎恢复为其默认本地化"en-US".我知道这种文化应该与Datepicker配合使用,因为每当我在Razor引擎中声明Datepicker时,它都会正确渲染.这是Razor的代码示例:

The culture seems to revert to its default localization "en-US". I know this culture should work with Datepicker because whenever I declare the Datepicker within the Razor engine it renders correctly. Here´s a code example from Razor:

@(Html.Kendo().DatePicker()
  .Name("RegisterDatePicker")
  .Start(CalendarView.Month)
  .Value(DateTime.Now)
  .Format("dd.MMMM yyyy")
  .Events(e => e.Change("registerDatePicker_OnChange"))
  .Culture("is-IS")
)

有人能指出我的Datepicker的脚本声明有什么问题吗?

Can anyone point out whats wrong with the script declaration of my Datepicker?

推荐答案

为了 Kendo全球化可以正常工作,在包含Kendo脚本之后,您还需要包含正确的其他区域性脚本.

In order to the Kendo Globalization work correctly you need to include the correct additional culture scripts after you have included the Kendo scripts.

因此,在这种情况下,您需要包含kendo.culture.is-IS.js脚本:

So in you case you need the to include the kendo.culture.is-IS.js script:

<script src="jquery.js"></script>
<script src="kendo.all.min.js"></script>
<script src="kendo.culture.is-IS.js"></script>

这篇关于Kendo DatePicker文化无法正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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