This is a migrated thread and some comments may be shown as answers.
kendo.parseDate fails across frame boundaries.
1 Answer 12 Views
This is a migrated thread and some comments may be shown as answers.
Andrés
Top achievements
Rank 1
Andrés asked on 08 May 2013, 09:30 PM
Hi,
I've been fighting this issue all day, trying to make sense of it and why would the first check the function does fails:
            if (value instanceof Date) {
                return value;
            }

It turns out that when you're passing around information across frames (iframe), the instanceof does not recognize it as a date anymore (but it is). So the function goes on to assume it's a string and tries to call value.indexOf(...) and that of course fails because it's not a string.

After some investigation I ran across a solution to this, and that would be to change this initial check from what it was to:
            if (Object.prototype.toString.call(value) === '[object Date]') {
                return value;
            }

I tested it in my environment and it works. I'm attaching a test case so you can verify. Hope you can fix this soon, be it with my suggestion or by any other means.
Thanks a lot!
Andrés

1 Answer, 1 is accepted

Sort by
0
Georgi Krustev
Telerik team
answered on 10 May 2013, 03:49 PM
Hello,

 
Here is a quote of my answer to the ticket opened on the same subject:

Thank you for contacting us and for providing a solution for the described issue. Unfortunately, even if we incorporate the suggested solution, we still cannot guarantee that Kendo UI will work. We use instaceofacross our code for checks like value instanceof kendo.data.ObservableObject, which will not work in this case. What I can suggest you is to modify the source code of the Kendo UI manually In order to add support for these scenarios. Note that we can not provide support for modified Kendo UI.

I will ask you continue our conversation in only one thread in order to avoid any duplications

Regards,
Georgi Krustev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Asked by
Andrés
Top achievements
Rank 1
Answers by
Georgi Krustev
Telerik team
Share this question
or