Hi!
This is my code to get the difference of two dates in Javascript.
var today = new Date();
var dd = today.getDate();
var mm = today.getMonth()+1; //January is 0!
var yyyy = today.getFullYear();
if (dd < 10)
{
dd='0'+dd
}
if (mm < 10)
{
mm='0'+mm
}
today = mm+'/'+dd+'/'+yyyy;
var minutes = 1000*60;
var hours = minutes*60;
var days = hours*24;
var foo_date1 = getDateFromFormat(today, "M/d/y");
var foo_date2 = getDateFromFormat("02/28/2015", "M/d/y");
var diff_date = Math.round((foo_date2 - foo_date1)/days);
var ans = Math.abs(diff_date);
alert(ans);
This works fine in my localhost. However, when I upload it to the server. It does not work anymore.
When I use IE, this is the error it founds.
I tried to chmod the file permissions for all the javascripts and jquery it needs even the folder that these javascript is contained. But it does not do anything.
Kindly help me please :((