Skip to content

Instantly share code, notes, and snippets.

@darlacameron
Created October 22, 2014 17:33
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 darlacameron/b4caf25d22c9a7a67eb1 to your computer and use it in GitHub Desktop.
Save darlacameron/b4caf25d22c9a7a67eb1 to your computer and use it in GitHub Desktop.
AP Styles for Moment.js
months = [
[1,"Jan."],
[2,"Feb."],
[3,"March"],
[4,"April"],
[5,"May"],
[6,"June"],
[7,"July"],
[8,"Aug."],
[9,"Sept."],
[10,"Oct."],
[11,"Nov."],
[12,"Dec."]
];
function apDate(d){
var mth = moment(d).format("M");
var m = months[mth-1][1];
var date = moment(d).format("D");
var y = moment(d).format("YYYY");
return (m + ' ' + date + ', ' + y);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment