Commit f8f86e29 authored by Nicholas J Anderson's avatar Nicholas J Anderson
Browse files

Import next meeting date/time/location from Calendar

parent a4e4afba
......@@ -62,18 +62,49 @@ channel on <a href="https://www.freenode.net/">freenode</a>, #srct. More ways to
get in touch are on our <a href="{{ url_for('contact') }}">contact page</a>.</p>
<legend><i class="fa fa-gavel fa-fw"></i>&nbsp;<strong>Next Meeting</strong></legend>
<p>Due to the upcoming break, the meetings this Saturday (March 7<sup>th</sup>
) and the following Saturday (March 14<sup>th</sup>) have been canceled. Our
next meeting is scheduled for Saturday March 21<sup>st</sup> at 2pm in SUB1 3B. For more
information, check out our
<a href="{{ url_for('calendar') }}">calendar</a> or visit our
<p id="meetingDate">Please wait while we fetch the upcoming meeting information...</p>
<!--<a href="{{ url_for('calendar') }}">calendar</a> or visit our
<a href="https://www.facebook.com/MasonSRCT">Facebook</a> or
<a href="https://www.twitter.com/MasonSRCT">Twitter</a> pages.</p>
<a href="https://www.twitter.com/MasonSRCT">Twitter</a> pages.</p>-->
</div>
{% endblock %}
{% block scripts %}
<!-- <script src="/static/js/parallax.min.js"></script>
var scene = document.getElementById('jumboparallax');
var parallax = new Parallax(jumboparallax); -->
<script>
$(function() {
// Public API Key for Google Calendar access (Key from nander13's gmail account)
var apiKey = "AIzaSyDgaXDxmMEdtbIaq3TXmf4jxXZLG8CeoMs";
// Instead of loading the _entire_ Google API library, let's just make a GET request
$.getJSON("https://www.googleapis.com/calendar/v3/calendars/kaiuicpoki9p3u92eklent0eec%40group.calendar.google.com/events",
{
// Expand one recurring event to multiple events
"singleEvents":"true",
"orderBy":"startTime",
// Starting now until we hit the first event.
"timeMin":new Date().toISOString(),
"showDeleted":"false",
"maxResults":"1",
// Change this if the title of the weekly meeting on the calendar changes!
"q":"SRCT+Weekly+Meeting",
"key":apiKey
},
function(data) {
//console.log(data.items[0])
var d = new Date(data.items[0].start.dateTime),
monthName = d.toLocaleString("en-us", {month: "long"}),
dateOptions = { weekday: 'long', month: 'long', day: 'numeric' },
timeOptions = { hour: 'numeric', minute: 'numeric'},
dateString = d.toLocaleString("en-us", dateOptions),
timeString = d.toLocaleString("en-us", timeOptions);
$("#meetingDate").text("Join us for our next meeting in "+data.items[0].location+" at "+timeString+" on "+dateString +".")
});
});
</script>
{% endblock %}
......@@ -69,6 +69,8 @@
<script src="/static/js/jquery-2.0.3.min.js"></script>
<script src="/static/js/bootstrap.min.js"></script>
{% block scripts %}
{% endblock %}
<!-- Piwik -->
<script type="text/javascript">
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment