Created
October 22, 2014 17:33
-
-
Save darlacameron/b4caf25d22c9a7a67eb1 to your computer and use it in GitHub Desktop.
AP Styles for Moment.js
This file contains 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
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