Skip to content

Commit

Permalink
Allow flighttime to be > 23hr59
Browse files Browse the repository at this point in the history
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 projecthorus#5
  • Loading branch information
KevWal authored Jan 2, 2023
1 parent 0a12454 commit 7afa19d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions js/pred/pred-new.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -656,4 +656,4 @@ function writeHourlyPredictionInfo(settings, metadata, request) {

$("#run_time").html(run_time);
$("#dataset").html(dataset);
}
}

0 comments on commit 7afa19d

Please sign in to comment.