Skip to content
Snippets Groups Projects
Unverified Commit 36ff5d3b authored by BMItter's avatar BMItter Committed by GitHub
Browse files

Checkin - overnight check ins without date on the second day (EXPOSUREAPP-6453) (#2890)

parent 54ab791e
No related branches found
No related tags found
No related merge requests found
...@@ -9,8 +9,19 @@ inline val CheckIn.checkoutInfo: String ...@@ -9,8 +9,19 @@ inline val CheckIn.checkoutInfo: String
val checkInStartUserTZ = checkInStart.toUserTimeZone() val checkInStartUserTZ = checkInStart.toUserTimeZone()
val checkInEndUserTZ = checkInEnd.toUserTimeZone() val checkInEndUserTZ = checkInEnd.toUserTimeZone()
val dayFormatted = checkInStartUserTZ.toLocalDate().toString(DateTimeFormat.mediumDate()) return if (checkInStartUserTZ.toLocalDate() == checkInEndUserTZ.toLocalDate()) {
val startTimeFormatted = checkInStartUserTZ.toLocalTime().toString(DateTimeFormat.shortTime()) val dateFormat = DateTimeFormat.shortDate()
val endTimeFormatted = checkInEndUserTZ.toLocalTime().toString(DateTimeFormat.shortTime()) val timeFormat = DateTimeFormat.shortTime()
return "$dayFormatted, $startTimeFormatted - $endTimeFormatted" val dayFormatted = checkInStartUserTZ.toString(dateFormat)
val startTimeFormatted = checkInStartUserTZ.toString(timeFormat)
val endTimeFormatted = checkInEndUserTZ.toString(timeFormat)
String.format("%s, %s - %s", dayFormatted, startTimeFormatted, endTimeFormatted)
} else {
val dateTimeFormat = DateTimeFormat.shortDateTime()
val startTimeFormatted = checkInStartUserTZ.toString(dateTimeFormat)
val endTimeFormatted = checkInEndUserTZ.toString(dateTimeFormat)
String.format("%s - %s", startTimeFormatted, endTimeFormatted)
}
} }
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