Hi,
I've got a problem with kendo culture and treeView read action.
I've got bilingual application, with en-US and pl-PL culture, which I set like this:
Client side: (var culture = "pl-PL" or "en-US")
<
script
src
=
"@Url.Content("
~/Scripts/kendo/cultures/kendo.culture." + culture + ".min.js")"></
script
>
<
script
src
=
"@Url.Content("
~/Scripts/kendo/messages/kendo.messages." + culture + ".min.js")"></
script
>
<
script
>kendo.culture("@culture");</
script
>
Server side: (ex.: CultureInfo cultureInfo = new CultureInfo("pl-PL");)
Thread.CurrentThread.CurrentCulture = Thread.CurrentThread.CurrentUICulture = cultureInfo;
It seems to work well.
I've got a view with grid and treeView. Both has read action with additional data, getting like this:
.Read(read => read.Action(@"ReadOfertyTree", @"Oferty").Data(@"filterGrid")) <- treeView
(...)
.Read(read => read.Action(@"ReadOferty", @"Oferty").Data(@"filterGrid")) <- grid
(...)
function filterGrid() {
return {
dataOd: dataOd,
dataDo: dataDo,
klient: klient,
zamow: zamow
};
}
dataOd and dataDo both are read from kendoDatePicker. In both cases I can see in network in my browser, that date is sending in format dd.MM.yyy for pl culture and MM/dd/yyyy for en culture. In case of en, everything is allright BUT in pl case I faced with strange behaviour.
In controller's action read for grid I got dates:
1.11.2018 is read as 1st of november 2018
30.11.2018 is read as 30th of november 2018
BUT in treeView read action I've got:
1.11.2018 is read as 11th of january 2018
30.11.2018 is read as null
I don't set culture in any other places. Both controlls are in the same cshtml file and both read action in the same controller. What's wrong?