Skip to content
Snippets Groups Projects
Unverified Commit 349957fa authored by Matthias Urhahn's avatar Matthias Urhahn Committed by GitHub
Browse files

Remove duplicate date formatting code (DEV) #3149

parent efaa0ff3
No related branches found
No related tags found
No related merge requests found
...@@ -107,20 +107,25 @@ class QrCodeDetailFragment : Fragment(R.layout.trace_location_organizer_qr_code_ ...@@ -107,20 +107,25 @@ class QrCodeDetailFragment : Fragment(R.layout.trace_location_organizer_qr_code_
val endTime = uiState.endDateTime!!.toDateTime() val endTime = uiState.endDateTime!!.toDateTime()
eventDate.isGone = false eventDate.isGone = false
val startDay = startTime.toLocalDate().toString("dd.MM.yyyy")
val startHour = startTime.toLocalTime().toString("HH:mm")
val endDay = endTime.toLocalDate().toString("dd.MM.yyyy")
val endHour = endTime.toLocalTime().toString("HH:mm")
eventDate.text = if (startTime.toLocalDate() == endTime.toLocalDate()) { eventDate.text = if (startTime.toLocalDate() == endTime.toLocalDate()) {
requireContext().getString( requireContext().getString(
R.string.trace_location_organizer_detail_item_duration, R.string.trace_location_organizer_detail_item_duration,
startTime.toLocalDate().toString("dd.MM.yyyy"), startDay,
startTime.toLocalTime().toString("HH:mm"), startHour,
endTime.toLocalTime().toString("HH:mm") endHour
) )
} else { } else {
requireContext().getString( requireContext().getString(
R.string.trace_location_organizer_detail_item_duration_multiple_days, R.string.trace_location_organizer_detail_item_duration_multiple_days,
startTime.toLocalDate().toString("dd.MM.yyyy"), startDay,
startTime.toLocalTime().toString("HH:mm"), startHour,
endTime.toLocalDate().toString("dd.MM.yyyy"), endDay,
endTime.toLocalTime().toString("HH:mm") endHour
) )
} }
} else { } else {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment