Skip to content

armgit / TREK

Public Imported from GitHub
0

The most complete open-source travel planner: real-time collaboration, bookings, budgets, packing lists, journals, offline PWA, SSO and an AI-ready MCP server, with planet-wide place search and routing built in.

511 B
Raw Blame
/**
 * How long a route via (a charging stop, a rest area a plugin route places on
 * the drawn day) holds the drive, as both map renderers label it: whole
 * minutes, with the hours split off once there are any. One function for both,
 * so the Leaflet tooltip and the GL label cannot disagree on the wording.
 */
export function formatViaDwell(seconds: number): string {
  const h = Math.floor(seconds / 3600);
  const m = Math.round((seconds % 3600) / 60);
  return h > 0 ? `${h} h ${m} min` : `${m} min`;
}