Recently, when I was doing mobile web, I was successful with chrome debugging on my PC, but there were strange problems with the real machine on the iphone. After a series of debugging found that the date is related to the problem. It was initially suspected to be a production environment problem, but the same problem has arisen with the Mac version of Safari debugging locally. Looking at some of the data, it turns out that Safari's support for the new date function for JavaScript has a rather bizarre problem.
Typically, the date is formatted as a YYYY-MM-DD because it is accustomed to the DateTime format in SQL, but Safari does not support such a format, so when you enter the following statement, it returns an empty time.
New Date (' 2016-04-17 ');
Safari support Format is YYYY/MM/DD, the difference is mainly in the short horizontal-and slash/, and slashes such a format in other common browsers can also be normal operation, so only need to be replaced by a slash, the conversion function is as follows:
New Date (' 2016-04-17 '. Replace (/-/g, "/"));
The above is a small set up to introduce the JavaScript new date functions in Safari encountered in the pit, hope for everyone to help, if you have any questions please give me a message, small series will promptly reply to everyone. Here also thank you very much for the cloud Habitat Community website support!