The first format makes no fucking sense to start with, the US is the main country which uses mid-endian dates and it doesn't use "-" as a separator.
But beyond that, don't use `new Date(string)`: the only spec-defined format is a restricted ISO 8601[0], though the horror show that is RFC 2822 datetimes is conventionally supported by everybody because it's the standard stringification (Date#toString).
Everything else is implementation-defined, and likely heuristic.
new Date('12-27-2022'); works in Chrome but returns an invalid date in Safari & FireFox.
new Date('12/27/2022'); works for all browsers.