Commit 432c7d48 authored by Zac Wood's avatar Zac Wood

Change instructions for Google Calendar upload, attempt TZ fix

parent 98cd5ae0
Pipeline #3601 passed with stages
in 28 minutes and 15 seconds
...@@ -63,7 +63,7 @@ const initListeners = () => { ...@@ -63,7 +63,7 @@ const initListeners = () => {
const items = Array.from(document.querySelectorAll('.section-item')); const items = Array.from(document.querySelectorAll('.section-item'));
items.forEach(item => (item.onclick = () => remove(item))); items.forEach(item => (item.onclick = () => remove(item)));
document.getElementById('open-modal-btn').onclick = setUrlInModal; // document.getElementById('open-modal-btn').onclick = setUrlInModal;
document.getElementById('download-ics').onclick = downloadIcs; document.getElementById('download-ics').onclick = downloadIcs;
document.getElementById('add-to-system').onclick = addToSystemCalendar; document.getElementById('add-to-system').onclick = addToSystemCalendar;
document.getElementById('save-image').onclick = saveImage; document.getElementById('save-image').onclick = saveImage;
......
...@@ -60,7 +60,7 @@ const saveImage = () => { ...@@ -60,7 +60,7 @@ const saveImage = () => {
}; };
const initListeners = () => { const initListeners = () => {
document.getElementById('open-modal-btn').onclick = setUrlInModal; // document.getElementById('open-modal-btn').onclick = setUrlInModal;
document.getElementById('download-ics').onclick = downloadIcs; document.getElementById('download-ics').onclick = downloadIcs;
document.getElementById('add-to-system').onclick = addToSystemCalendar; document.getElementById('add-to-system').onclick = addToSystemCalendar;
document.getElementById('save-image').onclick = saveImage; document.getElementById('save-image').onclick = saveImage;
......
require 'icalendar' require 'icalendar'
require 'icalendar/tzinfo'
require 'time' require 'time'
# Creates a iCal object given a list of section ids # Creates a iCal object given a list of section ids
...@@ -7,6 +8,10 @@ class Schedule ...@@ -7,6 +8,10 @@ class Schedule
@cal = Icalendar::Calendar.new @cal = Icalendar::Calendar.new
@cal.x_wr_calname = 'GMU Schedule' @cal.x_wr_calname = 'GMU Schedule'
tzid = "America/New_York"
tz = TZInfo::Timezone.get tzid
@cal.add_timezone tz.ical_timezone(Time.now)
@course_sections = crns.map { |crn| @course_sections = crns.map { |crn|
CourseSection.latest_by_crn(crn) CourseSection.latest_by_crn(crn)
} }
......
...@@ -4,12 +4,10 @@ ...@@ -4,12 +4,10 @@
<%= javascript_include_tag 'moment.min' %> <%= javascript_include_tag 'moment.min' %>
<%= stylesheet_link_tag 'fullcalendar.min' %> <%= stylesheet_link_tag 'fullcalendar.min' %>
<button id="open-modal-btn" type="button" class="btn btn-primary" data-toggle="modal" data-target="#exportModal"> <button id="open-modal-btn" type="button" class="btn btn-primary" data-toggle="modal" data-target="#exportModal">
Export Schedule Export Schedule
</button> </button>
<button id="save-image" class="btn btn-secondary">Save as PNG</button> <button id="save-image" class="btn btn-secondary">Save Image</button>
<div id="calendar"></div> <div id="calendar"></div>
...@@ -63,10 +61,8 @@ Want to share your schedule with your friends? Send them this link:<br/> ...@@ -63,10 +61,8 @@ Want to share your schedule with your friends? Send them this link:<br/>
<h5>Google Calendar</h5> <h5>Google Calendar</h5>
<strong>On desktop:</strong> <strong>On desktop:</strong>
<br /> <br />
Open your <a href="https://calendar.google.com/">Google Calendar</a>. Click the "Settings" button in the top First, download the calendar file using the "Download calendar file" below. Open your <a href="https://calendar.google.com/" target="_blank">Google Calendar</a>. Click the "Settings" button in the top
right, and then click the Settings tab. In the menu on the left, click "Add calendar" and "From URL". Now, right, and then click the Settings tab. In the menu on the left, click "Import & export" and "Import". Now, upload the calendar file you downloaded and click "Import".
paste the following link inside the text box: <br />
<code id="calendar-link"></code>
<br /> <br />
<strong>On mobile (Android only):</strong> <strong>On mobile (Android only):</strong>
<br /> <br />
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<button id="open-modal-btn" type="button" class="btn btn-primary" data-toggle="modal" data-target="#exportModal"> <button id="open-modal-btn" type="button" class="btn btn-primary" data-toggle="modal" data-target="#exportModal">
Export Schedule Export Schedule
</button> </button>
<button id="save-image" class="btn btn-secondary" onclick="saveImage()">Save as PNG</button> <button id="save-image" class="btn btn-secondary" onclick="saveImage()">Save Image</button>
<div id="calendar"></div> <div id="calendar"></div>
...@@ -35,10 +35,8 @@ ...@@ -35,10 +35,8 @@
<h5>Google Calendar</h5> <h5>Google Calendar</h5>
<strong>On desktop:</strong> <strong>On desktop:</strong>
<br /> <br />
Open your <a href="https://calendar.google.com/">Google Calendar</a>. Click the "Settings" button in the top First, download the calendar file using the "Download calendar file" below. Open your <a href="https://calendar.google.com/" target="_blank">Google Calendar</a>. Click the "Settings" button in the top
right, and then click the Settings tab. In the menu on the left, click "Add calendar" and "From URL". Now, right, and then click the Settings tab. In the menu on the left, click "Import & export" and "Import". Now, upload the calendar file you downloaded and click "Import".
paste the following link inside the text box: <br />
<code id="calendar-link"></code>
<br /> <br />
<strong>On mobile (Android only):</strong> <strong>On mobile (Android only):</strong>
<br /> <br />
......
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