JSFiddle - React, Tailwind, and code Playground

JavaScript

alert(new Date('2012-09-01'));
alert ( !/Invalid|NaN/.test(new Date('2012-09-01')));