Commit ebd57ef8 authored by Zac Wood's avatar Zac Wood

Added exclusion for first day

parent 482e3aad
......@@ -22,6 +22,7 @@ class CalendarGeneratorController < ApplicationController
event.summary =
event.description = section.title
event.location = section.location
event.dtstart =, section.start_time))
event.dtend =, section.end_time))
event.rrule =
......@@ -56,9 +57,18 @@ class CalendarGeneratorController < ApplicationController
def exdates_for_section(section)
Closure.where(semester: section.course.semester).map { |closure|
exdates = Closure.where(semester: section.course.semester).map { |closure|
generate_exdate(, section.start_time)
# Every section's start_date is the first Monday of the semester.
# So we need to add an exclusion for that day unless the class is held on Mondays
exdates << generate_exdate(
) unless section.days.start_with? "M"
def generate_exdate(date, time)
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