Skip to content

ERROR TypeError: Cannot read properties of undefined (reading 'setCalendarTimezone') #279

Open
@R3zu3

Description

@R3zu3

Hello, I have a small bug when changing the calendar time zone
Summarizing my implementation, I have the following:

Component.html

<ejs-schedule [timezone]="timeZone" [showHeaderBar]="false"></ejs-schedule>

Component.ts

@ViewChild('calendar') calendar!: ScheduleComponent;

I tried all the combinations of this instructions and they all give an error.

setTimeZone(zone: string) {
this.timeZone = zone;
this.calendar.setProperties({ timeZone: zone });
this.calendar.render();
}

The MX and VE buttons are to test the time zone change

When I change the zone, the events are updated correctly at the corresponding time and vice versa, but the error breaks the calendar and I have to restart to enable it, render() refreshes it but it remains broken in the same way

Anyway the error seems widespread and breaks the calendar instance (apparently)

Reviewing the error trace it seems that the schedule.js file on line 1548 is missing the same validation that is on lines 1443, 1458, 1527

 schedule.js

 schedule.js

calendar-home.component.html:127 ERROR TypeError: Cannot read properties of undefined (reading 'setCalendarTimezone')
   at Schedule2.onPropertyChanged (schedule.js:1548:39)
   at Base2.dataBind (base.js:120:18)
   at Component2.dataBind (component.js:285:35)
   at timer (zone.js:2367:41)
   at _ZoneDelegate.invokeTask (zone.js:402:31)
   at core.mjs:14556:55
   at AsyncStackTaggingZoneSpec.onInvokeTask (core.mjs:14556:36)
   at _ZoneDelegate.invokeTask (zone.js:401:60)
   at Object.onInvokeTask (core.mjs:14869:33)
   at _ZoneDelegate.invokeTask (zone.js:401:60)

Thanks regards, I hope I'm not wrong. ;)

Metadata

Metadata

Assignees

No one assigned

    Labels

    scheduleSchedule component

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions