@oslokommune/punkt-elements
Version:
Komponentbiblioteket til Punkt, et designsystem laget av Oslo Origo
20 lines (19 loc) • 684 B
TypeScript
/**
* Shared timepicker time utility functions.
* Used by both Elements and React implementations.
* Only framework-agnostic functions belong here.
*/
/**
* Returns true if the string matches the HH:MM format with valid hour/minute ranges.
*/
export declare const isValidTimeString: (value: string) => boolean;
/**
* Parses an HH:MM string into zero-padded [hours, minutes] strings.
* Returns null for empty or invalid values.
*/
export declare const parseTimeString: (value: string) => [string, string] | null;
/**
* Converts an HH:MM string to total minutes since midnight.
* Assumes a valid time string.
*/
export declare const timeToMinutes: (time: string) => number;