Commit 0ad460ce authored by Daniel W Bond's avatar Daniel W Bond

Merge branch '46-meeting-info' into 'master'

Resolve "Stuck fetching meeting info"

Closes #46

See merge request srctweb!68
parents 3399d613 f6436342
...@@ -326,14 +326,17 @@ $(function() { ...@@ -326,14 +326,17 @@ $(function() {
"key":apiKey "key":apiKey
}, },
function(data) { function(data) {
//console.log(data.items[0]) if(data.items.length == 0) {
var d = new Date(data.items[0].start.dateTime), $("#meetingDate").text("No meetings scheduled yet. Check back soon!");
monthName = d.toLocaleString("en-us", {month: "long"}), } else {
dateOptions = { weekday: 'long', month: 'long', day: 'numeric' }, var d = new Date(data.items[0].start.dateTime),
timeOptions = { hour: 'numeric', minute: 'numeric'}, monthName = d.toLocaleString("en-us", {month: "long"}),
dateString = d.toLocaleString("en-us", dateOptions), dateOptions = { weekday: 'long', month: 'long', day: 'numeric' },
timeString = d.toLocaleString("en-us", timeOptions); timeOptions = { hour: 'numeric', minute: 'numeric'},
$("#meetingDate").text("Join us for our next meeting in "+data.items[0].location+" at "+timeString+" on "+dateString +". Make sure to bring your laptop!") 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 +". Make sure to bring your laptop!")
}
}); });
}); });
</script> </script>
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