Events
$.ajax({
url: "https://www.google.com/calendar/feeds/[email protected]/public/full?alt=json"
}).done(function(data) {
var html="";
$.each( data.feed.entry, function( i, eventData ) {
html +="<div class='entry'>";
html +="<strong>" + eventData.title.$t +"</strong>";
html +="<p>" + eventData.content.$t +"</p>";
var d = new Date(eventData.gd$when[0].startTime);
var ampm = d.getHours() >= 12 ? 'pm' : 'am';
var time = d.getHours() >= 12 ? d.getHours()-12 : d.getHours();
time = time == 0 ? 12 : time;
html +="<div class='post-info'>"
html +="<div class='date'>" + (d.getMonth()+1) + "/" + d.getDate()+ " @" + time + ampm + "</div>";
html +="<div class='location'>" + eventData.gd$where[0].valueString+
" <a href='http://maps.google.com/maps?q="+eventData.gd$where[0].valueString+"'>map"+"</a></div></div>";
html +="</div>";
});
$(".post").append(html);
});