0

I have a kendo data picker to display the date, I want to have the date information in French for that I used the efficient script in my layout page like bellow:

<script>
        kendo.Culture("fr-FR");
    </script>
    <script src="~/Scripts/kendo/culture/kendo.fr-FR.js"></script>
    <script src="~/Scripts/kendo/kendo.tooltip.min.js"></script>
</script>

I even add the globalize script but even that the culture doesn’t change:

![<script type="text/javascript" src="~/scripts/globalize/globalize.js"></script>
    <script type="text/javascript" src="~/scripts/globalize/cultures/globalize.culture.fr-FR.js"></script>][1]

enter image description here This my kendo datapicker image:

@chxzy here is my kendo datapicker

 @(Html.Kendo().DatePickerFor(m => m./****).Events(e => e.Open("onOpen")).Footer("Today - #=kendo.toString(data, 'd') #").MonthTemplate("# if ($.inArray(+data.date, birthdays) != -1) { #" +
                                     "<div class=\"birthday\"></div>" +
                                 "# } #" +
                                 "#= data.value #")
                   .HtmlAttributes(new { @class = "form-control" })
                           .Culture("fr-FR")
    )

and here is my script code:

var today = new Date(),
    birthdays = [
        +new Date(today.getFullYear(), today.getMonth(), 11),
        +new Date(today.getFullYear(), today.getMonth() + 1, 6),
        +new Date(today.getFullYear(), today.getMonth() + 1, 27),
        +new Date(today.getFullYear(), today.getMonth() - 1, 3),
        +new Date(today.getFullYear(), today.getMonth() - 2, 22)
    ];

function onOpen() {
    var dateViewCalendar = this.dateView.calendar;
    if (dateViewCalendar) {
        dateViewCalendar.element.width(340);
    }
};
4

2 回答 2

1

kendo.Culture("fr-FR");您是否在包含相应的文化 JavaScript 文件之前致电。

如果是这样,请先包含您的 js 文件,然后调用 kendo.Culture...

<script src="~/Scripts/kendo/culture/kendo.fr-FR.js"></script>
<script src="~/Scripts/kendo/kendo.tooltip.min.js"></script>
<script>
    kendo.Culture("fr-FR");
</script>
于 2015-05-08T11:05:13.710 回答
0

您能否尝试将以下内容添加到您的 datepicker js 代码中。

$("#datePicker").kendoDatePicker({
  culture: "fr-FR",
  //....
})

编辑

查看您的 Kendo MVC 代码后,您能否尝试更改以下内容,因为我认为手动指定页脚的格式将解决此问题。

这个:

.Footer("Today - #=kendo.toString(data, 'd') #")

对此:

.Footer("Today - #=kendo.toString(data, 'dd/MM/yyyy') #")
于 2015-05-08T11:07:05.407 回答