momentjs diff between code example
Example 1: moment diff
const dateDifference = moment(date1).diff(moment(date2))
Example 2: moment js difference between two dates
var admission = moment('{date1}', 'DD-MM-YYYY');
var discharge = moment('{date2}', 'DD-MM-YYYY');
discharge.diff(admission, 'days');