Skip to content

Instantly share code, notes, and snippets.

@robertocarroll
Created October 25, 2014 11:52
Show Gist options
  • Save robertocarroll/61966d903c630099564f to your computer and use it in GitHub Desktop.
Save robertocarroll/61966d903c630099564f to your computer and use it in GitHub Desktop.
Convert date format using for loop
JS
var index;
for (index = 0; index < documents.length; ++index) {
documents[index].startDate = moment(documents[index].startDate, "YYYY,MM,DD").format("YYYY-MM-DD");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment