You need separate minutes and hours and calculate difference for each. Bear mind if start minutes bigger than finish minutes you should minus 1 hour. In result you need minutes difference divide by 60 minutes.
var start = "00:56";
var finish = "05:59";
function getHours(time) {
return time.split(":")[0];
}
function getMinutes(time) {
return time.split(":")[1];
}
function getDifference(start, finish) {
var hoursDifference = getHours(finish) - getHours(start);
var minutesDifference = function () {
if (getMinutes(finish) > getMinutes(start)) {
return getMinutes(finish) - getMinutes(start);
} else {
return getMinutes(start) - getMinutes(finish);
}
};
if (getMinutes(start) > getMinutes(finish)) {
hoursDifference = hoursDifference - 1;
}
return hoursDifference + "." + (minutesDifference() / 60).toString().replace("0.", "");
}
var difference = getDifference(start, finish);