Skip to content

Instantly share code, notes, and snippets.

@carbide-public
Last active March 6, 2017 15:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save carbide-public/a7d049b57a68f85ed147224152c37074 to your computer and use it in GitHub Desktop.
Save carbide-public/a7d049b57a68f85ed147224152c37074 to your computer and use it in GitHub Desktop.
untitled
import moment from 'moment';
const isDateTime1 = moment('2016-01-01', moment.ISO_8601, true).isValid();
const isDateTime2 = moment('2017-03-01 16:56:11.828019+00', moment.ISO_8601, true).isValid();
import moment from 'moment';
const dateFormat = 'YYYY-MM-DD';
const isDateTime1 = moment('2016-01-01', dateFormat, true).isValid();
const isDateTime2 = moment('2017-03-01 16:56:11.828019+00', dateFormat, true).isValid();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment