I ran into some unusual problem.
var past = utils.stringToDate(past, 'dd-mm-yyyy', '-');
var today = new Date();
past.setHours(0, 0, 0, 0);
today.setHours(0, 0, 0, 0);
return today > past? true: false;
The above code is used to set the flag, and this flag is used to determine the user flow. Now the problem is that it works in most browsers, including IE, but does not work in Safari on windows (works fine in Safari, Mac) and Opera.
past is the date I get from the server, and the value 27-09-2015.
stringToDate is a function that formats the date in the specified format.
Test case
past : 27-09-2015
today: 25-09-2015
Even higher, the code returns truein the specified browsers.
So the question is, is there any difference in browsers when comparing date objects in javascript, and if so, which lesser-known cases should I know?
.