Created
November 25, 2008 06:14
-
-
Save slashk/28815 to your computer and use it in GitHub Desktop.
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
/* | |
* basic unordered list widget | |
* returns <li>01/15/08: Events name (CA)</li> with link | |
*/ | |
function eventCallback(obj) { | |
var events = obj; | |
var outputHTML = "<ul>"; | |
var baseurl = "http://www.mtbcalendar.com/events/" | |
for (var i=0; i<events.length; i++){ | |
var splitdate = events[i].start_date.split("/"); | |
var newdate = splitdate[1]+'/'+splitdate[2]+'/'+splitdate[0].replace(/^20/,""); // gives us 01/15 format | |
outputHTML += ('<li>'+newdate+': <a href="'+baseurl+events[i].id+'">'+events[i].name+'</a> ('+events[i].state+')</li>'); | |
} | |
outputHTML += "</ul>"; | |
document.getElementById('mtbcalendar').innerHTML = outputHTML; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment