diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/ui/dialogs/teacherabsence/TeacherAbsenceAdapter.kt b/app/src/main/java/pl/szczodrzynski/edziennik/ui/dialogs/teacherabsence/TeacherAbsenceAdapter.kt index 35292685..c64ea891 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/ui/dialogs/teacherabsence/TeacherAbsenceAdapter.kt +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/dialogs/teacherabsence/TeacherAbsenceAdapter.kt @@ -30,9 +30,17 @@ class TeacherAbsenceAdapter( val teacherAbsence: TeacherAbsenceFull = teacherAbsenceList[position] holder.teacherAbsenceTeacher.text = teacherAbsence.teacherFullName + + val time = when(teacherAbsence.dateFrom.compareTo(teacherAbsence.dateTo)) { + 0 -> teacherAbsence.dateFrom.formattedStringShort + else -> teacherAbsence.dateFrom.formattedStringShort + " - " + teacherAbsence.dateTo.formattedStringShort + } + + holder.teacherAbsenceTime.text = time } class ViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) { var teacherAbsenceTeacher: TextView = itemView.findViewById(R.id.teacherAbsenceTeacher) + var teacherAbsenceTime: TextView = itemView.findViewById(R.id.teacherAbsenceTime) } } diff --git a/app/src/main/res/layout/row_dialog_teacher_absence_item.xml b/app/src/main/res/layout/row_dialog_teacher_absence_item.xml index c7befdf2..6aacce23 100644 --- a/app/src/main/res/layout/row_dialog_teacher_absence_item.xml +++ b/app/src/main/res/layout/row_dialog_teacher_absence_item.xml @@ -21,9 +21,16 @@ + +