UNPKG

@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.

14 lines • 538 B
/** * Return the day of week (1-7) for a given ISO 8601 datetime string. * * - Monday=1 through Sunday=7. * - Returns null for invalid input. * * @param value ISO datetime string * @returns Day of week (1-7) or null on invalid input * * @example parseDayOfWeekFromDateTime("2024-01-01T12:00:00") // 1 (Monday) * @example parseDayOfWeekFromDateTime("2024-01-07T00:00:00") // 7 (Sunday) * @example parseDayOfWeekFromDateTime("invalid") // null */ export declare function parseDayOfWeekFromDateTime(value: string): number | null;