Can you share which version you're testing on? Your first reply code didn't work on my Rev 80 on AWS (more specifically 1.00.80.00.391861). Now I am concerned about potential compatibility if you are testing on a newer release.
Re: using toISOString instead of toJSON - just a matter of habit I suppose. In theory, the toISOString should bomb on me or return the invalid date rather than a null, so any error is more visible.
Thanks again,
Jim Giffin