Our powerful JS Calendar component


Post by durban »

When I try to set today's day (here it's Wednesday) as a non working day and hide it, I got this error: 'Uncaught TypeError: can't access property "appendChild", i is null'
You can find a test case in file attachments.

Attachments
minimal test case.zip
Test case for bug reproduction (put the bryntum files in the bryntum folder)
(2.73 KiB) Downloaded 42 times

Post by Animal »

nonWorkingDays is an object.

https://www.bryntum.com/docs/calendar/api/Calendar/view/Calendar#config-nonWorkingDays

I tweaked the "Basic" example to hide Wednesdays and all views hide Wednesdays:

Screenshot 2022-09-28 at 14.26.23.png
Screenshot 2022-09-28 at 14.26.23.png (248.74 KiB) Viewed 389 times

Post by durban »

It works fine when it's loaded, but I got the error when I set the resource that hides Wednesday as the only active resource by clicking on the resource list.
In the test case, the variable nonWorkingDays is an object, but I still got the same error message


Post by Animal »

When you set a breakpoint at this line:

Screenshot 2022-09-28 at 16.36.09.png
Screenshot 2022-09-28 at 16.36.09.png (16.22 KiB) Viewed 385 times

What does the var nonWorkingDays look like?


Post by durban »

In the screenshots, the variable nonWorkingDays is an object with value 0 being true, 3 being true and 6 being true

Attachments
NonWorkingDaysIsObject.png
NonWorkingDaysIsObject.png (7.29 KiB) Viewed 384 times
NonWorkingDaysIsObject (2).png
NonWorkingDaysIsObject (2).png (2.85 KiB) Viewed 384 times

Post by Animal »

Yep, that's fully correct. The the extra detail was that the view contains "today", and there you found our bug!

The updating of the current time indicator doesn't handle the today element not being there (It's a hidden non working day)

Here is a ticket for it: https://github.com/bryntum/support/issues/5333


Post Reply