I know that date format "dd/mm/yyyy" can be achieved like this:
var d = new Date();
var day = d.getDate();
var month = (d.getMonth() +1);
var year = d.getFullYear();
document.write("Today is " +day+ "/" +month+ "/" +year+ "<br>");
Date picker
var x = new Date(document.getElementById("dateSelection"));
However how can I convert those to a single date object so I can then compare it against date picker in a simple statement like this:
if (d > x)
{
document.write("Date from the past");
}
else if (d < x)
{
document.write("Date from the future");
}
else
{
document.write("Date equals today's date");
}
Thanks for help I'm novice at this.