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.

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