let startDate = new Date('2021-12-02');
let endDate = new Date('2021-12-30');
let checkDate = new Date('2021-12-31');
if(startDate <= checkDate && endDate >= checkDate){
console.log(123);
} else {
console.log(456);
}
//$uj@y
const dateCheck = (from, to, check) => {
let fDate,lDate,cDate;
fDate = Date.parse(from);
lDate = Date.parse(to);
cDate = Date.parse(check);
if((cDate <= lDate && cDate >= fDate)) return true
return false;
}
dateCheck("02/05/2021","02/09/2021","02/07/2021")
if((check.getTime() <= to.getTime() && check.getTime() >= from.getTime())) alert("date contained");