Kendo DatePicker culture not working correctly

允我心安 提交于 2019-12-12 22:59:01

问题


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

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")
)

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


回答1:


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

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>


来源:https://stackoverflow.com/questions/20872035/kendo-datepicker-culture-not-working-correctly

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!