Custom Annual View error

2 posts, 0 answers
  1. Paul
    Paul avatar
    4 posts
    Member since:
    Mar 2020

    Posted 24 Aug 2020 Link to this post

    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?

  2. Paul
    Paul avatar
    4 posts
    Member since:
    Mar 2020

    Posted 26 Aug 2020 in reply to Paul Link to this post

    Can anyone help?
Back to Top