There's seems to be a bug is Safari on iOS (12.0.1, 12.1) and Mac. It's causing the interval.range function to fail for the Day interval in the Brazilian time zone when crossing daylight savings time (Nov 3 - 4). For me it breaks when trying to draw a bottom axis.
The problem is with setDate() which fails on Nov 3, never getting to Nov 4 and going into an infinite loop.
For example if you go to the console of safari on a mac that's been switched to the Brazilian time zone and type:
d = new Date("11/1/2018 00:00");
d.setDate(d.getDate() + 1);d.setHours(0,0,0,0); d;
d.setDate(d.getDate() + 1);d.setHours(0,0,0,0); d;
d.setDate(d.getDate() + 1);d.setHours(0,0,0,0); d;
d.setDate(d.getDate() + 1);d.setHours(0,0,0,0); d;
You'll get:
< Thu Nov 01 2018 00:00:00 GMT-0300 (-03)
< Fri Nov 02 2018 00:00:00 GMT-0300 (-03)
< Sat Nov 03 2018 00:00:00 GMT-0300 (-03)
< Sat Nov 03 2018 00:00:00 GMT-0300 (-03)
< Sat Nov 03 2018 00:00:00 GMT-0300 (-03)
Note without the setHours() it looks like this:
d = new Date("11/1/2018 00:00");
< Thu Nov 01 2018 00:00:00 GMT-0300 (-03)
d.setDate(d.getDate() + 1); d;
< Fri Nov 02 2018 00:00:00 GMT-0300 (-03)
d.setDate(d.getDate() + 1); d;
< Sat Nov 03 2018 00:00:00 GMT-0300 (-03)
d.setDate(d.getDate() + 1); d;
< Sat Nov 03 2018 23:00:00 GMT-0300 (-03) <-- oops. Didn't quite make it.
Off by one hour.
The d3 code is "correct" and the underlying iOS/Mac Safari code is broken. However it still crashes my app (the os eventually kills the runaway thread). For me it's breaking when a bottom axis is drawn that crosses nov 3/4 (in the Brazilian time zone).
I wonder if you'd have any suggestions on how to fix or work around this problem.
PS: Chrome is fine on Mac. Didn't check it on iOS though I heard it's based on Safari or probably WKWebview (which is actually what's crashing for me...iOS app has a big blank page.).