Skip to content

minZoned

minZoned(zonedDateTimes: string[]): string | null

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

  • Returns null if the array is empty or contains no valid dates.
  • Validation is performed on each item in the array.
ParameterTypeDescription
zonedDateTimesstring[]Array of ISO ZonedDateTime strings

The earliest zoned datetime string, or null on invalid input

import { minZoned } from "@northguild/gmt/zoned/calculate";
minZoned(["2024-03-10T12:00:00[America/New_York]", "2024-03-15T12:00:00[America/New_York]"]) // "2024-03-10T12:00:00-04:00[America/New_York]"
zonedDateTimes
output 

zoned/calculate/minZoned.ts