Open lyon-fnal opened 3 months ago
Hi - yeah, there are some notes on this in the release blog post and I added a new note in the using DataView API example.
The gist is that in different JavaScript contexts, objects like Date objects have different prototype roots, so if you create a Date object in the top frame (window.top) and then pull it into the iframe then check if it is instanceof Date
, it will give you false
, because Date
in the iframe is a different prototype than Date
in the top frame.
Recreating Date objects as in the example is the clearest way to work around this. I don't think there is a way to work around it in the general case, this is a fundamental attribute of how JavaScript works across contexts.
Thanks for the explanation and the additional documentation!!
Hi, Any idea why the formatting is lost on the date?
This affects plotting when getting data from
windows.top
as instead of using the actual date for the axis ticks, it will use seconds since epoch.