I am trying to use custom data attribute
<span class="k-nav-day" data-dt="kendo.toString(date, 'dd/MM/yyyy')">
</span>
But when i try below code in JavaScript,
var dateOfHeader = $(this).data("dt");
It still gives me in quotes and its not getting evaluated
"kendo.toString(date, 'dd/MM/yyyy')"
It should have formatted the 'date' and date should be assigned to variable "dateOfHeader" = 27/05/2015
Note: I do not have any error in console
Background on Question
I am using scheduler control and I need to render some color based on dates. my data source is having JSON as follow
var mydatafromApi = ({
date:01/01/2013,
percentage=30%,
color = red
},
{
date:02/01/2013,
percentage=40%
color = blue
});
Now I need to compare every date of scheduler/calendar and display background based on this JSON data
So while rendering I am storing date in custom data attribute, but to read it back I am facing issues.