Created
April 16, 2014 20:13
-
-
Save zeroedin/10928213 to your computer and use it in GitHub Desktop.
reformat cals events
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
$(function(){ | |
var month = []; | |
month[0] = "JAN"; | |
month[1] = "FEB"; | |
month[2] = "MAR"; | |
month[3] = "APR"; | |
month[4] = "MAY"; | |
month[5] = "JUN"; | |
month[6] = "JUL"; | |
month[7] = "AUG"; | |
month[8] = "SEP"; | |
month[9] = "OCT"; | |
month[10] = "NOV"; | |
month[11] = "DEC"; | |
$('#cal .eventDate').each(function(i, event) { | |
ev = {} | |
ev.date = new Date($(this).text()); | |
ev.month = month[ev.date.getMonth()]; | |
ev.day = ev.date.getDate(); | |
$(this).html('<span class="eventMonth">' + ev.month + '</span><span class="eventDay">' + ev.day + '</span>') | |
ev.title = $(event).find('a').text(); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment