This is a migrated thread and some comments may be shown as answers.

Custom Annual View error

1 Answer 88 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Paul
Top achievements
Rank 1
Paul asked on 24 Aug 2020, 11:19 AM

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?

1 Answer, 1 is accepted

Sort by
0
Paul
Top achievements
Rank 1
answered on 26 Aug 2020, 08:00 AM
Can anyone help?
Tags
Scheduler
Asked by
Paul
Top achievements
Rank 1
Answers by
Paul
Top achievements
Rank 1
Share this question
or