difference between two times moment js code example
Example 1: moment date difference in days
moment(new Date()).diff(moment(new Date()), 'days') // 0
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');