Hi,
I'm trying to define my custom (annual) view on scheduler in angularJS.
My definition is:
var SchedulerAnnualView = kendo.ui.SchedulerView.extend({
startDate: function () {
var date = kendo.ui.AgendaView.fn.startDate.call(this);
if (date == null)
date = new Date();
return new Date( date.getYear(), 0, 1);
},
endDate: function () {
var date = kendo.ui.AgendaView.fn.startDate.call(this);
if (date == null)
date = new Date();
date.setDate(date.getDate() + 363);
return date;
},
nextDate: function () {
var start = kendo.ui.SchedulerView.fn.startDate.call(this);
if (start == null)
start = new Date();
return new Date(start.getFullYear() + 1, 0, 1);
},
previousDate: function () {
var start = kendo.ui.SchedulerView.fn.startDate.call(this);
if (start == null)
start = new Date();
return new Date(start.getFullYear() - 1, 0, 1);
}
}
When i click on my defined view the error occurs:
Uncaught TypeError: Cannot read property 'replace' of undefined
at Object.ve.format (kendo.all.js:822)
at r.dateForTitle (kendo.all.js:82119)
at init._renderView (kendo.all.js:93251)
at init._selectView (kendo.all.js:93217)
at init.view (kendo.all.js:93239)
at HTMLLIElement.<anonymous> (kendo.all.js:93504)
at HTMLDivElement.dispatch (jquery-2.2.0.min.js:3)
at HTMLDivElement.r.handle (jquery-2.2.0.min.js:3)
What's wrong in my code?