micnews / date-parse

Parse date value into valid Date() object or null

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

SYNOPSIS

Parse date value into valid Date() object or null. Never returns date object that is invalid and could throw like so:

new Date('not a date').toISOString() // throws RangeError: Invalid time value

Build Status

USAGE

var dateParse = require('date-parse');
dateParse('2014-12-30T21:17:46.826Z') // new Date('2014-12-30T21:17:46.826Z')
dateParse('not a date') // null

##LICENSE

MIT

About

Parse date value into valid Date() object or null

License:Other


Languages

Language:JavaScript 100.0%