I need to convert hours and minutes in minutes values. With pure JavaScript Date object I do the following:
var d = new Date();
var minutes = d.getHours() *
I didn't needed moment.js, at least worked for my scenarios:
console.log('converting 2 hours, 20 minutes and 120 seconds to minutes');
var hours = 2,
minutes = 20,
seconds = 120,
timeInminutes = (hours * 60) + minutes + (seconds / 60);
console.log('2 hours, 20 minutes and 120 seconds to minutes is', timeInminutes, ' minutes')