I'm working on getting an isolated example up and running, but maybe there's something obvious I'm missing.
We've got a SPA w/ multiple views, most of which are generated via templates. We're using Kendo charts, the scheduler and upload widgets in these views, which were all working fine until we implemented the kendo.culture functionality.
Users can switch between English and French (Canadian). In English our tile view template looks fine (screenshot 1.png), but when we switch to French, all the overlays are lost (screenshot 2.png. Other items on different views also disappear, including buttons and general text. The one common point seems to be the if statements in the template for all these elements are checking for the existence of a date, like so:
# if (typeof(data.Due) !== "undefined" && data.Due != null) { #
<
div
class
=
"date-overlay #= getDueClassTile(data.DueStatus, data.Type) #"
>
Due:
# if (data.DueStatus == 'Warning' || data.DueStatus == 'Overdue') { #
<
i
class
=
"fa-icon-exclamation-triangle"
></
i
>
# } #
#= data.Due #
</
div
>
# } #
We're also formatting the dates inside the datasource, and using the same checks:
schema : {
type:
"json"
,
data:
"Courses"
,
parse:
function
(data) {
var
courses = data.Courses;
$.map(courses,
function
(item, index) {
if
(
typeof
(item.Due) !==
"undefined"
&& item.Due !=
null
) {
item.Due = kendo.toString(kendo.parseDate(item.Due),
"dd-MMM-yyyy"
);
}
if
(
typeof
(item.CompletedDate) !==
"undefined"
&& item.CompletedDate !=
null
) {
item.CompletedDate = kendo.toString(kendo.parseDate(item.CompletedDate),
"dd-MMM-yyyy"
);
}
if
(
typeof
(item.LastCompleted) !==
"undefined"
&& item.LastCompleted !=
null
) {
item.LastCompleted = kendo.toString(kendo.parseDate(item.LastCompleted),
"MMM dd"
);
}
if
(
typeof
(item.SessionDate) !==
"undefined"
&& item.SessionDate !=
null
) {
item.SessionDate = kendo.toString(kendo.parseDate(item.SessionDate),
"dd-MMM-yyyy"
);
}
});
return
data;
}
}
It looks like something about the undefined/null checks in the datasource and/or template are failing when the dates are in French (since the if statements never get executed), but I'm not sure what it could be.