Port the tests of JavaScript's date parsing.

https://github.com/ariya/phantomjs/issues/12439