I have some client events for creating/updating events.
They are currently the same and call the same method:
Due to JSON serialization, I end up with dates being serialized as ticks when sent to the client. This function converts these ticks to a proper JavaScript Date() object. The code works perfectly fine.
We run into an error on random occasions. This happens maybe once a day per user. It is not repeatable but it was fixable. This code is from the Kendo.all.js file. The highlighted lines were added:
99% of the time things work fine. But sometimes this convertData() method is called before the client methods are called. Perhaps a threading or AJAX or promise issue? Perhaps there is one scenario where the client method is not being called? The real bug here is that convertData() can sometimes get called before the client’s event where I would have corrected by dates. This is another case where it is tough to upgrade Kendo versions because I need to port this as minified JavaScript to the custom downloaded minified file.
Here is the text from the browser’s F12 window when we hit this error (If I have not applied the fix above):
kendo?v=Brdc2jM0hzOFDq3Kj04CDAYP5xcGXPDm3x-vN4slHho1:1 Uncaught TypeError: f.start.getTimezoneOffset is not a function
at ai (kendo?v=Brdc2jM0hzOFDq3Kj04CDAYP5xcGXPDm3x-vN4slHho1:1:1182628)
at init.data (kendo?v=Brdc2jM0hzOFDq3Kj04CDAYP5xcGXPDm3x-vN4slHho1:1:1182352)
at init._readData (kendo?v=Brdc2jM0hzOFDq3Kj04CDAYP5xcGXPDm3x-vN4slHho1:1:96753)
at init._push (kendo?v=Brdc2jM0hzOFDq3Kj04CDAYP5xcGXPDm3x-vN4slHho1:1:90345)
at init._pushUpdate (kendo?v=Brdc2jM0hzOFDq3Kj04CDAYP5xcGXPDm3x-vN4slHho1:1:90237)
at init.e (jquery?v=9zl6bqYAmbr9FSUZX0T1VSNbWQ5Gc01X9-RaVvSk-7A1:1:95021)
at init.a (signalr?v=4OffKgJP3BKl-a0HMCu8SoFYj-iqmWy-1sbyLwYhtvk1:1:36810)
at init.dispatch (jquery?v=9zl6bqYAmbr9FSUZX0T1VSNbWQ5Gc01X9-RaVvSk-7A1:1:55579)
at y.handle (jquery?v=9zl6bqYAmbr9FSUZX0T1VSNbWQ5Gc01X9-RaVvSk-7A1:1:53581)
at Object.trigger (jquery?v=9zl6bqYAmbr9FSUZX0T1VSNbWQ5Gc01X9-RaVvSk-7A1:1:78599)