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_
val endTime = uiState.endDateTime!!.toDateTime()
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()) {
requireContext().getString(
R.string.trace_location_organizer_detail_item_duration,
startTime.toLocalDate().toString("dd.MM.yyyy"),
startTime.toLocalTime().toString("HH:mm"),
endTime.toLocalTime().toString("HH:mm")
startDay,
startHour,
endHour
)
} else {
requireContext().getString(
R.string.trace_location_organizer_detail_item_duration_multiple_days,
startTime.toLocalDate().toString("dd.MM.yyyy"),
startTime.toLocalTime().toString("HH:mm"),
endTime.toLocalDate().toString("dd.MM.yyyy"),
endTime.toLocalTime().toString("HH:mm")
startDay,
startHour,
endDay,
endHour
)
}
} 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