Documentation
¶
Overview ¶
Package duration provides helpers for converting between flight time representations. All internal storage uses integer minutes for lossless precision.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecimalHoursToMinutes ¶
DecimalHoursToMinutes converts decimal hours to integer minutes via rounding.
func FormatColonHM ¶
FormatColonHM returns a colon-separated hours:minutes string, e.g. "1:23". Suitable for EASA logbook PDF export.
func FormatDecimal ¶
FormatDecimal returns a decimal hours string with 1 decimal place, e.g. "1.4h".
func MinutesToDecimalHours ¶
MinutesToDecimalHours converts minutes to decimal hours for display/export.
func ParseDuration ¶
ParseDuration parses a flexible duration string into integer minutes. Accepted formats:
- "1:23" or "01:23" → 83 minutes (colon-separated hours:minutes)
- "1h23m" or "1h 23m" → 83 minutes
- "1h" → 60 minutes
- "23m" → 23 minutes
- "83" → 83 minutes (bare integer = minutes)
- "1.38" or "1.5" → decimal hours converted to minutes (83 or 90)
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.