From 7afa19d0533b11dab3e18830bedf609e3d9666c5 Mon Sep 17 00:00:00 2001 From: Kevin Walton Date: Mon, 2 Jan 2023 17:06:17 +0000 Subject: [PATCH] Allow flighttime to be > 23hr59 Allow flighttime to be > 23hr59, stopping a floater having "Flight Time: 0hr00" or any flight over 23hr59 showing a flight time of less than 24 hours. Fixing https://github.com/projecthorus/leaflet_predictor/issues/5 --- js/pred/pred-new.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/js/pred/pred-new.js b/js/pred/pred-new.js index 74ef84a..ccab97d 100644 --- a/js/pred/pred-new.js +++ b/js/pred/pred-new.js @@ -325,7 +325,7 @@ function plotStandardPrediction(prediction){ // Calculate range and time of flight var range = distHaversine(launch.latlng, landing.latlng, 1); var flighttime = ""; - var f_hours = Math.floor((prediction.flight_time % 86400) / 3600); + var f_hours = Math.floor(prediction.flight_time / 3600); var f_minutes = Math.floor(((prediction.flight_time % 86400) % 3600) / 60); if ( f_minutes < 10 ) f_minutes = "0"+f_minutes; flighttime = f_hours + "hr" + f_minutes; @@ -656,4 +656,4 @@ function writeHourlyPredictionInfo(settings, metadata, request) { $("#run_time").html(run_time); $("#dataset").html(dataset); -} \ No newline at end of file +}