turns out there is a current week too
* don't debug timetable cod on Sundays, since there are no lessons on Sunday
This commit is contained in:
parent
aa69d2242f
commit
b240beacc9
|
@ -150,8 +150,8 @@ class HomeFragment : Fragment() {
|
|||
for (dayIndex in dayIndexSearch..5) {
|
||||
dayTimetable = timetables[weekIndexSearch].timetable.days[dayIndex]
|
||||
|
||||
// some wired calendar magic, calculate the correct date to be shown ((timetable week - current week * 7) + days of calendar week + 1)
|
||||
val daysToAdd = (timetables[weekIndexSearch].meta.weekNumberYear - NotRetardedCalendar.getWeekOfYear() - 1) * 7 + dayIndex +1
|
||||
// some wired calendar magic, calculate the correct date to be shown ((timetable week - current week * 7) + (dayIndex - dayIndex of current week)
|
||||
val daysToAdd =(timetables[weekIndexSearch].meta.weekNumberYear - NotRetardedCalendar.getWeekOfYear()) * 7 + (dayIndex - NotRetardedCalendar.getDayOfWeekIndex())
|
||||
dayCardView.addTimetableDay(dayTimetable, daysToAdd)
|
||||
|
||||
// if there are no lessons don't show the dayCardView
|
||||
|
|
|
@ -40,8 +40,6 @@ import org.mosad.seil0.projectlaogai.controller.PreferencesController.Companion.
|
|||
import org.mosad.seil0.projectlaogai.controller.TCoRAPIController
|
||||
import org.mosad.seil0.projectlaogai.hsoparser.NotRetardedCalendar
|
||||
import org.mosad.seil0.projectlaogai.uicomponents.DayCardView
|
||||
import java.text.SimpleDateFormat
|
||||
import java.util.*
|
||||
|
||||
/**
|
||||
* The timetable controller class
|
||||
|
@ -122,8 +120,8 @@ class TimeTableFragment : Fragment() {
|
|||
for (dayIndex in startDayIndex..dayEndIndex) {
|
||||
val dayCardView = DayCardView(context!!)
|
||||
|
||||
// some wired calendar magic, calculate the correct date to be shown ((timetable week - current week * 7) + days of calendar week + 1)
|
||||
val daysToAdd = (timetableMeta.weekNumberYear - NotRetardedCalendar.getWeekOfYear() - 1) * 7 + dayIndex +1
|
||||
// some wired calendar magic, calculate the correct date to be shown ((timetable week - current week * 7) + (dayIndex - dayIndex of current week)
|
||||
val daysToAdd =(timetableMeta.weekNumberYear - NotRetardedCalendar.getWeekOfYear()) * 7 + (dayIndex - NotRetardedCalendar.getDayOfWeekIndex())
|
||||
dayCardView.addTimetableDay(timetable.days[dayIndex], daysToAdd)
|
||||
|
||||
// if there are no lessons don't show the dayCardView
|
||||
|
|
Loading…
Reference in New Issue