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?

有帮助吗?

解决方案

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>
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top