This is a migrated thread and some comments may be shown as answers.

culture on DatePicker...

2 Answers 1125 Views
Date/Time Pickers
This is a migrated thread and some comments may be shown as answers.
Snups
Top achievements
Rank 1
Snups asked on 01 Nov 2012, 12:00 AM
Hi,

I want to use 2 datepickers on same page with an different culture on each picker... it possible?
Ima able to set culture with kendo.culture("xyz"); but it global to all widgets...

Thx
Marco

2 Answers, 1 is accepted

Sort by
0
Iliana Dyankova
Telerik team
answered on 02 Nov 2012, 02:13 PM
Hi Marco,

I am glad to inform you that this functionality is already available in Kendo UI. In order to specify the culture for a particular widget (which depends on the current culture) you can use the culture configuration option. For example: 

$("#firstDate").kendoDatePicker({
  culture: "bg-BG",
  //....
});
 
$("#secondDate").kendoDatePicker({
  culture: "fr-FR",
  //....
})

Please make sure that all required scripts are included. More detailed information about the globalization is available at this help topic

Regards,
Iliana Nikolova
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Snups
Top achievements
Rank 1
answered on 02 Nov 2012, 02:37 PM
Hi,

Thx for reply.

Il create the instance of widgest with razor :
...
<p>
        @Html.LabelFor(m => m.date, "Date")
        <br />
        @Html.Kendo().DatePickerFor(m => m.date).Name("c1")
    </p>
    <p>
        @Html.LabelFor(m => m.montant, "Montant")
        <br />
        @Html.Kendo().NumericTextBoxFor(m => m.montant).Max(999999).Min(-999999).Format("c")
    </p>
...

I want to let the NumericTextBox (currency) as default (the default is base on browser culture?) and force the date picker to be "fr-CA".
At the moment... with the razor I am able to set the NumericTextBox with .Culture() but I am not able on the DatePicker.

I try this on the document ready :
 $(document).ready(function () {
        var c1 = $("#c1").data("kendoDatePicker");
c1.options.culture = "fr-CA";
    });

But still not working...

Marco
Tags
Date/Time Pickers
Asked by
Snups
Top achievements
Rank 1
Answers by
Iliana Dyankova
Telerik team
Snups
Top achievements
Rank 1
Share this question
or