Skip to content

chopDate

chopDate(value: string): string
import { chopDate } from "@northguild/gmt/plain/chop";

Return the PlainTime portion extracted from an ISO PlainDateTime string.

  • Extracts time components from a PlainDateTime.
  • Returns “” for invalid input.
Parameter Type Description
value string ISO PlainDateTime string

ISO PlainTime string or “” on invalid input

chopDate("2024-02-29T12:34:56") // "12:34:56"
chopDate("invalid") // ""

plain/chop/chopDate.ts