<%# Flying metrics. "Flight time" = Hobbs where recorded, else tach. %> <% periods = stats.periods %>
<% [ [ "Past 30 days", periods[0] ], [ "This year", periods[2] ], [ "Past 12 months", periods[1] ], [ "Since #{fmt_date(stats.first_date)}", periods[4] ] ].each do |title, p| %>
<%= title %>
<%= hours(p.flight) %> hrs
<%= pluralize(p.flights, "flight") %> · <%= hours(p.tach) %> tach · <%= number_with_delimiter(p.fuel) %> gal
<% end %>

Flight hours by month

Avg <%= hours(stats.monthly_average_past_year) %> hrs/month over the past year
<%= column_chart stats.flight_hours_by_month, height: "220px", colors: [ "#0369a1" ], ytitle: "hrs", library: { plugins: { legend: { display: false } } } %>

Totals

Flights logged
<%= number_with_delimiter(stats.count) %>
Flight time
<%= hours(stats.total_flight) %> hrs
Tach time
<%= hours(stats.total_tach) %> hrs
Average flight
<%= hours(stats.average_flight) %> hrs
Longest flight
<%= hours(stats.longest_flight) %> hrs
Fuel
<%= number_with_delimiter(stats.total_fuel) %> gal
Fuel burn
<%= stats.gph || "—" %> gal/hr
Airports visited
<%= stats.airports_visited %>
<% if stats.top_airports.any? %>
Most visited: <%= stats.top_airports.map { |code, n| "#{code} (#{n})" }.join(" · ") %>
<% end %>
By year <% stats.by_year.each do |y| %> <% end %>
YearFlightsFlight hrsTach hrsFuel (gal)Avg flight
<%= y.label %> <%= y.flights %> <%= hours(y.flight) %> <%= hours(y.tach) %> <%= number_with_delimiter(y.fuel) %> <%= y.flights.positive? ? hours(y.flight / y.flights) : "—" %>

Flight time is Hobbs time where recorded, otherwise tach time.