File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -149,7 +149,13 @@ function generate_vehicle_popup_text(vehicle, cache) {
149149 const scheduled_time_hh_mm = typeof scheduled_time == 'number' ? [ ( Math . floor ( scheduled_time / 60 ) ) % 24 , scheduled_time % 60 ] : null ;
150150 const now_mins = ( now_hh_mm [ 0 ] * 60 + now_hh_mm [ 1 ] ) % ( 24 * 60 ) ;
151151 const scheduled_mins = scheduled_time_hh_mm ? ( scheduled_time_hh_mm [ 0 ] * 60 + scheduled_time_hh_mm [ 1 ] ) % ( 24 * 60 ) : null ;
152- const delay = scheduled_mins ? ( now_mins - scheduled_mins ) % ( 24 * 60 ) : null ;
152+ let delay = scheduled_mins ? ( now_mins - scheduled_mins ) % ( 24 * 60 ) : null ;
153+ if ( 1000 < delay ) {
154+ delay -= 24 * 60 ;
155+ }
156+ else if ( delay < - 1000 ) {
157+ delay += 24 * 60 ;
158+ }
153159
154160 const delay_class = - 1 <= delay && delay <= 3 ? 'text-success' : 'text-danger fw-bold' ;
155161 const delayText = `${ delay > 0 ? '+' : '' } ${ delay } мин.` ;
You can’t perform that action at this time.
0 commit comments