@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.
15 lines • 637 B
TypeScript
/**
* Normalize formatted date/time strings for stable comparisons.
*
* - Removes Unicode format and bidi control characters (LRM/RLM/LRE/RLE/etc.)
* - Removes zero-width space and BOM
* - Normalizes various non-breaking and narrow spaces to plain space
* - Collapses repeated whitespace to a single space and trims
* - Normalizes common dash/minus characters to ASCII hyphen-minus
* - Optionally lowercases the result (disabled by default), in
* `opts.locale` (default `"en"`: a language, not one country)
*/
export declare function normalizeDateTime(input: string, opts?: {
lower?: boolean;
locale?: string;
}): string;