UNPKG

@burglekitt/gmt

Version:

Temporal-based date and time utilities with timezone support and polyfill integration

16 lines (15 loc) 574 B
/** * Return an ISO string with second precision removed from a PlainDateTime or PlainTime value. * * - Truncates to minute precision. * - Accepts both PlainDateTime and PlainTime formats. * - Returns "" for invalid input. * * @param value ISO PlainDateTime or PlainTime string * @returns ISO string trimmed to minutes or "" on invalid input * * @example chopSeconds("2024-02-29T12:34:56") // "2024-02-29T12:34" * @example chopSeconds("12:34:56") // "12:34" * @example chopSeconds("invalid") // "" */ export declare function chopSeconds(value: string): string;