UNPKG

@burglekitt/gmt

Version:

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

10 lines (9 loc) 480 B
// regex patterns exported for usage export const hour = /^(0[0-9]|1[0-9]|2[0-3])$/; export const minute = /^[0-5][0-9]$/; export const second = /^[0-5][0-9]$/; export const fractionalSecond = /^[0-9]{1,9}$/; // Backward-compatible alias; prefer fractionalSecond for new usage. export const millisecond = fractionalSecond; // ISO 8601 local time (extended): HH:mm[:ss[.fffffffff]] export const plainTime = /^(0[0-9]|1[0-9]|2[0-3]):[0-5][0-9](?::[0-5][0-9](?:[.,][0-9]{1,9})?)?$/;