Fix 'NaN. undefined NaN' dates on iOS.

<long list of curses about JavaScript>