時差24Hrs Timeを計算する必要があります。コードに何か問題があるようです
if ( shiftToMin >= shiftFromMin ){
shiftTotalMin = shiftToMin - shiftFromMin;
if( shiftFromHr < shiftToHr ){
shiftTotalHr = shiftToHr - shiftFromHr;
}else{
shiftTotalHr = ( 24 - shiftFromHr ) + shiftToHr;
}
}else{
shiftTotalMin = 60 - ( shiftFromMin - shiftToMin );
if( shiftFromHr < shiftToHr){
shiftTotalHr = ShiftToHr - shiftFromHr;
}else{
shiftTotalHr = ( 24 - shiftFromHr ) + shiftToHr;
}
shiftTotalHr = shiftTotalHr - 1;
}