var dateofvisit = moment('{visit}', 'DD-MM-YYYY'); var today = moment(); today.diff(dateofvisit, 'days');