Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
R3zu3 opened this issue Oct 4, 2024 · 0 comments
Labels
schedule Schedule component

Comments

@R3zu3
Copy link

R3zu3 commented Oct 4, 2024

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. ;)

@gsumankumar gsumankumar added the schedule Schedule component label Oct 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
schedule Schedule component
Projects
None yet
Development

No branches or pull requests

2 participants