import { DateFormatPart } from '../types'; /** * Validates and normalizes a raw date string according to a date format. * * - Caps day values at 31 (and later at the actual max days in the month) * - Caps month values at 12 * - Ensures the final combination is a valid calendar date * * Examples: * - "35 / 15 / 2024" + "dd / MM / yyyy" * day: 35 -> 31 * month: 15 -> 12 * result: "31 / 12 / 2024" * * - "31 / 11 / 2025" + "dd / MM / yyyy" * November has 30 days, so 31 -> 30 * result: "30 / 11 / 2025" * * - "29 / 02 / 2025" + "dd / MM / yyyy" * 2025 is not a leap year, February has 28 days * result: "28 / 02 / 2025" */ export default function formatDateInput(value: string, formatParts: DateFormatPart[]): string;