index.tsx876 chars26 lines
This function checks if the date is in European or American format based on the separator used (i.e. "." or "/" or "-"). Once the format is determined, the day, month, and year are extracted and a new Date object is created, taking into account that the month is zero-indexed in the Date constructor.
gistlibby LogSnag