Commit 361c33b8 authored by Jiri Strojil's avatar Jiri Strojil

New preselection

parent 30a46220
......@@ -16,6 +16,21 @@ class Semester
11 => 2
}.freeze
SEMESTER_PRESELECTION_MAP = {
1 => 2,
2 => 2,
3 => 2,
4 => 1,
5 => 1,
6 => 1,
7 => 1,
8 => 1,
9 => 1,
10 => 2,
11 => 2,
12 => 2,
}.freeze
class << self
def parse(string)
return unless string
......@@ -116,10 +131,12 @@ class Semester
)
end
def preselect_semester(offset = -4.months)
Semester.semester_range_from_start(
Semester.semester_start_time(@context + offset)
)
def preselect_semester
if SEMESTER_PRESELECTION_MAP[@context.month] == Semester.number(current)
current
else
previous
end
end
# params:
......
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