Check if date is valid

PHOTO EMBED

Wed Jan 05 2022 11:18:29 GMT+0000 (Coordinated Universal Time)

Saved by @desiboli ##javascript ##js

const isDateValid = (...val) => !Number.isNaN(new Date(...val).valueOf());
isDateValid("December 17, 1995 03:24:00");
// Result: true
content_copyCOPY

https://blog.devgenius.io/15-javascript-codes-you-will-always-need-e8569903dd1