Several days ago, one of my friend ask me for help. He wrote a piece of Javascript code, which will select two day’s date from the Calendar, then show both of them in a certain format. There is one extra task, calculate the number of days between two selected dates.
The problem he met was that all functions worked properly in Chrome. But when he run this Javascript in Safari, he always got NaN when he used new Date(dateString) to create Date object. Furthermore, this script was working perfectly several days ago.
Read more