I'm trying to use a single datetime field in my datasource to display the date and time pieces separately, but the formatting isn't working for some reason.
Here's piece of example JSON:
{
"Course"
: {
"Name"
:
"Test Course"
,
"ChapterData"
:[{
"Name"
:
"Module 1"
,
"TaskData"
:[{
"Name"
:
"Module 1 Task 1"
,
"CompletedDate"
:
"05\/12\/2015 19:25:43"
}]
}]
}}
<
i
class
=
"fa-icon-check mar-rt-sm"
></
i
>#= kendo.toString(data.ChapterData[c].TaskData[t].CompletedDate, 'dd-MMM-yyyy') #
<
span
class
=
"hidden-xs"
>#= kendo.toString(data.ChapterData[c].TaskData[t].CompletedDate, 'h:mm tt') #</
span
>
As you can see, I'm trying to display the date as "12-May-2015" and the time as "7:25 PM", but I just keep getting the whole, unformatted string ("05/12/2015 19:25:43") on my display. I wasn't able to find any information on time formatting specifically, and even when I created separate nodes in the JSON (ie. CompletedDate and CompletedTime), I still couldn't get the formatting to work.