Skip to content

chopTime

chopTime(value: string): string

Return the PlainDate portion extracted from an ISO PlainDateTime string.

  • Extracts date components from a PlainDateTime.
  • Returns "" for invalid input.
ParameterTypeDescription
valuestringISO PlainDateTime string

ISO PlainDate string or "" on invalid input

import { chopTime } from "@northguild/gmt/plain/chop";
chopTime("2024-02-29T12:34:56") // "2024-02-29"
output 

plain/chop/chopTime.ts