UNPKG

@northguild/gmt

Version:

Date and time library for JavaScript and TypeScript, built on TC39 Temporal: time zones, DST, business days, ISO 8601 strings in and out. Never throws.

13 lines • 502 B
/** * Extracts the local date portion from an ISO 8601 zoned datetime string. * * - Extracts date components (year, month, day) from a ZonedDateTime. * - Returns "" for invalid input. * * @param value ISO 8601 zoned datetime string * @returns Local date string YYYY-MM-DD or "" for invalid * * @example chopZonedTime("2024-02-29T14:30:45.123-03:00[America/Sao_Paulo]") // "2024-02-29" * @example chopZonedTime("invalid") // "" */ export declare function chopZonedTime(value: string): string;