Google JSON calendar not sorted by date

I tried to work with the Google Calendar JSON API, but I had problems. I managed to get it to work with jQuery, but for some reason, the Google JSON provided is not sorted by date, nor does it seem to take into account some events.

Here is the code I'm using:

<script> $.getJSON("http://www.google.com/calendar/feeds/weimar.org_cnijr5sa383f7kl28eu63996ec%40group.calendar.google.com/public/full?alt=json-in-script&max-results=25&singleevents=false&futureevents=true&sortorder=descending&callback=?", function(json){ var html = '<ul id="event_feed">'; $.each(json.feed.entry,function(i,entry) { html += '<li>' + $.format.date(entry['gd$when'][0].startTime + ' 00:00:00.000', "yyyy-MM-dd") + '</li>'; }) html += '</ul>'; $('#calendar').html(html); }); </script> 

How can this be fixed? To keep things simple, I just add the date of each event to the div. Format.date () is just a plugin that I use to format the date.

+4
source share
1 answer

Give this move:

 &orderby=starttime 
+2
source

Source: https://habr.com/ru/post/1392803/


All Articles