diff --git a/custom.js b/custom.js index c277d0e..5b46448 100644 --- a/custom.js +++ b/custom.js @@ -3,13 +3,18 @@ ltc.map; ltc.meetups = []; ltc.markers = {}; - + + // get week range for meetups + let today = new Date; + let lastDow = 14 - today.getDay(); const api = {}; api.group = 'LearnTeachCode'; - api.perPage = 15; api.offset = 0; api.path = 'https://api.meetup.com/2/events?&sign=true&photo-host=public'; - api.url = api.path + '&group_urlname=' + api.group + '&page=' + api.perPage; + api.startWeekDate = '0'; + api.endWeekDate = lastDow + 'd'; + api.status = 'upcoming'; + api.url = api.path + '&group_urlname=' + api.group + '&status=' + api.status + '&time=' + api.startWeekDate + ',' + api.endWeekDate; api.err = "Error occurred processing Meetup API URL"; // Get Meetup Data @@ -24,6 +29,7 @@ } function processData(data) { + data.days = getCurrentDates(2); data.results.forEach( function( meetup, index ) { // Get event formatted dates and time data.results[index].d = getDateFormats( meetup ); @@ -33,6 +39,7 @@ // List new meetups listMeetups(data); mapMeetups(data); + listMeetupsinWeekView(data); } function mapMeetups(data){ @@ -128,7 +135,7 @@ if(data.meta.total_count > data.meta.count && data.meta.count >= api.perPage){ list += '
Visit our Meetup.com page for details on our next meetings.
@@ -71,5 +88,6 @@