Im getting dates as strings in two different date formats:
Like
Format 1 => 25.03.20 (DD.MM.YY)
Format 2 => 2025-08-05 (YYYY-MM-DD)
I thought for option Nr 1 this: moment(dateString, "YYYY-MM-DD HH:mm").isValid() would be false. But is not, this test with a string in Format 1 is also true.
How can I check if a date is in Format 1 and if it is then make a new string like in Format 2 ?
moment(date, ['DD.MM.YY' 'YYYY-MM-DD'], true)
.