jquery - Duration between two dates with or without momentjs -


i trying figure out how can duration between 2 dates either or without momentjs.

here code have implemented in table using bootstrap-table

<tr>      <th id="startedat" data-field="startedat" data-formatter="dateformatter">started at</th>      <th id="finishedat" data-field="finishedat" data-formatter="dateformatter">finished at</th>      <th data-formatter="duration">duration</th> 

in javascript use

function dateformatter(value) {     return moment().format("dddd, mmmm yyyy, h:mm:ss a"); 

but how set function duration? ideas

with moment can use .diff

  var = moment([2007, 0, 29]);   var b = moment([2007, 0, 28]);   a.diff(b) // 86400000 

Comments