You can test for the minutes or seconds of the hours:
function verificarDiferencaHorario(inicialMin, finalMin) {
var totalMin = Number(finalMin - inicialMin);
console.log(Math.trunc(totalMin / 60).toString() + ":" + (totalMin % 60).toString());
}
Assuming the times you mentioned:
function verificarHorario() {
var inicial = "11:20", final = "16:40";
var splInicial = inicial.split(":"), splFinal = final.split(":");
var inicialMin = (Number(splInicial[0] * 60)) + Number(splInicial[1]);
var finalMin = (Number(splFinal[0] * 60)) + Number(splFinal[1]);
verificarDiferencaHorario(inicialMin, finalMin);
}
The same goes for days: the last conversion in minutes and the checkDifferentialTime function returns the difference in hours and minutes.