mirror of
https://github.com/acamarata/solar-spa.git
synced 2026-06-30 19:04:28 +00:00
Add typedoc and typedoc-plugin-markdown as devDependencies. Add typedoc.json config targeting src/index.ts with markdown output to .github/wiki/api. Add docs script to package.json. Generate initial API reference pages. Part of T-E8-03 — TypeDoc automation for all 12 JS/TS packages.
978 B
978 B
solar-spa / formatTime
Function: formatTime()
formatTime(
hours):string
Defined in: index.ts:113
Purpose: Convert fractional hours to an HH:MM:SS string. Inputs: hours, fractional hours (e.g. 6.5 for "06:30:00"); values ≥24 wrap Outputs: "HH:MM:SS" string, or "N/A" for non-finite/negative inputs Constraints: Non-finite and negative values occur during polar day/night; returning "N/A" lets callers display a sensible label without special-casing. SPORT: packages.md → solar-spa row
Parameters
hours
number
Fractional hours (e.g. 6.5 for 06:30:00). Values >= 24 wrap.
Returns
string
Formatted time string in HH:MM:SS, or "N/A" for invalid input.
Example
formatTime(6.5) // "06:30:00"
formatTime(12) // "12:00:00"
formatTime(Infinity) // "N/A"