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
0
Iliana Nikolova
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!
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";
});