Jump to content

Aircraft Hours


steelerboi

Recommended Posts

Hi Nabeel,

I was wondering whether it would be possible to change the format used to show total hours flown by an aircraft.

I think the issue stems from the time first entered into the PIREP as a non-standard format, e.g. 1.3 for 1 hr 30 mins rather than 1.5 or 90 mins.

As such, the total hours flown by one of my aircraft is showing as 3.9 which of course is actually 4 hrs 30 mins.

It's not a mega problem, but just one which results in some head scratching when looking at the reports in the admin reports section ;)

Link to comment
Share on other sites

  • 3 weeks later...

Hi Nabeel,

Did you get chance to look into this ?

I think it's a combination of the field type in the database and the SUM() query which is adding up flighttime in AircraftStats.class.php.

So naturally, if there are two PIREPs with flightime values of 1.4 and 1.3 (i.e. 1 hr 40 and 1 hr 30), the SUM() literally adds them together as 2.7 and this is displayed on the aircrafts reports page in the admin panel.

I was thinking perhaps that storing flighttime as minutes would be a possible option, then using code to convert mins to hh:mm on each page where you want the total to be displayed. However, I'm not sure how this would impact other functions which use the value.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...