Last active
December 19, 2015 05:59
-
-
Save andrejko/5907713 to your computer and use it in GitHub Desktop.
Proper date parsing in Javascript
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Proper date parsing. Works in Safari */ | |
function parseDate(input) { | |
var parts = input.match(/(\d+)/g); | |
return new Date(parts[0], parts[1]-1, parts[2]); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment