check date is greater than today in javascript code example
Example 1: js check if date is future
var now = new Date();
if (before < now) {
// selected date is in the past
}
Example 2: check if date is greater than current date javascript
var date = document.getElementById("inputDate").value;
var varDate = new Date(date); //dd-mm-YYYY
var today = new Date();
if(varDate >= today) {
//Do something..
alert("Working!");
}