1
I need to issue an Alert if the chosen date is less than the current date. I did so:
var strData = "15/08/2017";
var partesData = strData.split("/");
var data = new Date(partesData[2], partesData[1] - 1, partesData[0]).toDateString();
if(data < new Date().toDateString())
{
alert("Menor");
}
I put on the 15th and returned Minor.
That’s right
I put on the 16th did not return anything.
That’s right
I put on the 17th and returned Minor
You are wrong
I wish I knew where I was going wrong
Tried to take the
toDateString
and only compare purely the date?– Sorack
If I take it off he accuses that counts the mileseconds
– durtto
I adjusted my answer to remove time and compare
– Sorack