I want to subtract the pastDate with current date and check if the different is greater than 7 days. I am trying to do with momentjs but the subtract doesn't seems working my way.
pastDate= "2018-03-09 22:53:19";
dateFrom = moment(Date.now() - pastDate).format('YYYY-MM-DD HH:mm:ss');
if(dateFrom >= 7 ){
console.log("Expiry Date");
}
Please help me with correct syntax.