Iam trying to perform Subtraction in Momentjs:-
// Find the duration between two dates
var breakfast1 = moment('11:32','HH:mm');
var lunch1 = moment('12:52','HH:mm');
alert( moment.duration(lunch1 - breakfast1).humanize() + ' between meals' ); // 1 hours between meals
Output is alerting Only Hours .But How can I get "01:20"as Output Instead of 1 hour Any Ideas ?
how to generate Minutes along with Hours
.humanize() will always round to a specific interval. Break your code up and manually create the display you want...