Skip to content

Instantly share code, notes, and snippets.

@zeroedin
Created April 16, 2014 20:13
Show Gist options
  • Save zeroedin/10928213 to your computer and use it in GitHub Desktop.
Save zeroedin/10928213 to your computer and use it in GitHub Desktop.
reformat cals events
$(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