You were close. You just need to use the duration.asHours()
method (see the docs).
var duration = moment.duration(end.diff(startTime));
var hours = duration.asHours();
You were close. You just need to use the duration.asHours()
method (see the docs).
var duration = moment.duration(end.diff(startTime));
var hours = duration.asHours();