@burglekitt/gmt
Version:
Temporal-based date and time utilities with timezone support and polyfill integration
15 lines (14 loc) • 522 B
TypeScript
/**
* Return the UTC datetime string with a trailing Z removed if present.
*
* - Uses regex to remove trailing "z" or "Z".
* - Returns "" for invalid input.
*
* @param value UTC datetime string (ISO 8601)
* @returns UTC datetime string without trailing Z or "" on invalid input
*
* @example chopUtc("2024-03-10T12:00:00Z") // "2024-03-10T12:00:00"
* @example chopUtc("2024-03-10T12:00:00") // "2024-03-10T12:00:00"
* @example chopUtc("invalid") // ""
*/
export declare function chopUtc(value: string): string;