If you are using **REACT OR REACT NATIVE**, use this and it will work (Working like charm)
If the two dates are the same, it will return TRUE otherwise FALSE
const compareDate = (dateVal1, dateVal2) => {
if (dateVal1.valueOf() === dateVal2.valueOf()){
return true;
}
else { return false;}
}