xxxxxxxxxx
function myFunction() {
var yesterday = moment().subtract(1, "day").format("YYYY-MM-DD");
var SpecialToDate = document.getElementById("theDate").value;
if (moment(SpecialToDate, "YYYY-MM-DD", true).isAfter(yesterday)) {
alert("date is today or in future");
console.log("date is today or in future",SpecialToDate);
} else {
alert("date is in the past");
console.log("date is in the past",SpecialToDate);
}
}
xxxxxxxxxx
function myFunction() {
var yesterday = moment().subtract(1, "day").format("YYYY-MM-DD");
var SpecialToDate = document.getElementById("theDate").value;
if (moment(SpecialToDate, "YYYY-MM-DD", true).isAfter(yesterday)) {
alert("date is today or in future ");
console.log("date is today or in future")
} else {
alert("date is in the past");
console.log("date is in the past");
}
}
xxxxxxxxxx
function myFunction() {
var yesterday = moment().subtract(1, "day").format("YYYY-MM-DD");
var SpecialToDate = document.getElementById("theDate").value;
if (moment(SpecialToDate, "YYYY-MM-DD", true).isAfter(yesterday)) {
alert("date is today or in future");
console.log("date is today or in future",SpecialToDate);
} else {
alert("date is in the past");
console.log("date is in the past",SpecialToDate);
}
}