Time different jquery
let start = $ ( '.baseRosterStartTime' ). val (); let end = $ ( '.baseRosterEndTime' ). val (); s = start . split ( ':' ); e = end . split ( ':' ); min = e [ 1 ] - s [ 1 ]; hour_carry = 0 ; if ( min < 0 ){ min += 60 ; hour_carry += 1 ; } hour = e [ 0 ] - s [ 0 ] - hour_carry ; min = (( min / 60 ) * 100 ). toString () diff = hour + ":" + min . substring ( 0 , 2 ); $ ( '.totalhours' ). val ( diff );