Skip to content

minTime

minTime(times: string[]): string
import { minTime } from "@northguild/gmt/plain/calculate";

Return the earliest (minimum) of the given PlainTime values.

  • Returns null if the array is empty or contains no valid times.
  • Validation is performed on each item in the array.
Parameter Type Description
times string[] Array of ISO PlainTime strings (e.g. “14:30:00”)

The earliest time string, or null on invalid input

minTime(["14:30:00", "09:00:00", "20:45:00"]) // "09:00:00"
minTime([]) // null

plain/calculate/minTime.ts