Skip to content

Instantly share code, notes, and snippets.

@hatched
Created May 9, 2012 20:11
Show Gist options
  • Save hatched/2648479 to your computer and use it in GitHub Desktop.
Save hatched/2648479 to your computer and use it in GitHub Desktop.
normalizeIsoDate: function(date) {
Y.log('normalizeIsoDate', 'info', this.name);
var dateString = date.replace(/-/g, '/'),
normalizedDate;
normalizedDate = new Date(dateString);
if (normalizedDate == "Invalid Date") {
return new Date();
}
return normalizedDate
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment