fix(eventDetails): Fix showing time for instant events
This commit is contained in:
parent
ae2efe89f2
commit
13b0664f6e
|
@ -117,11 +117,18 @@ class EventDetailsActivity : AppCompatActivity() {
|
||||||
private fun setEventDetails() {
|
private fun setEventDetails() {
|
||||||
// Set basic event details
|
// Set basic event details
|
||||||
tvEventTitle.text = event.title
|
tvEventTitle.text = event.title
|
||||||
tvEventStartTime.text = getString(R.string.event_start_time, formatDateTime(event.start_time.toLocalDateTime()))
|
|
||||||
tvEventEndTime.text = getString(R.string.event_end_time, formatDateTime(event.end_time.toLocalDateTime()))
|
|
||||||
tvEventDescription.text = event.description
|
tvEventDescription.text = event.description
|
||||||
tvEventCreatedAt.text = getString(R.string.event_created_at, formatDateTime(event.created_at.toLocalDateTime()))
|
tvEventCreatedAt.text = getString(R.string.event_created_at, formatDateTime(event.created_at.toLocalDateTime()))
|
||||||
|
|
||||||
|
//
|
||||||
|
if (event.start_time == event.end_time) {
|
||||||
|
tvEventStartTime.text = getString(R.string.instant_event_time, formatDateTime(event.start_time.toLocalDateTime()))
|
||||||
|
tvEventEndTime.visibility = View.GONE
|
||||||
|
} else {
|
||||||
|
tvEventStartTime.text = getString(R.string.event_start_time, formatDateTime(event.start_time.toLocalDateTime()))
|
||||||
|
tvEventEndTime.text = getString(R.string.event_end_time, formatDateTime(event.end_time.toLocalDateTime()))
|
||||||
|
}
|
||||||
|
|
||||||
val userId = (application as MyApplication).tokenManager.userId
|
val userId = (application as MyApplication).tokenManager.userId
|
||||||
|
|
||||||
// Set categories or show the placeholder
|
// Set categories or show the placeholder
|
||||||
|
|
|
@ -100,4 +100,5 @@
|
||||||
<string name="edit_category">Edit category</string>
|
<string name="edit_category">Edit category</string>
|
||||||
<string name="please_enter_a_category_name">Please enter a category name</string>
|
<string name="please_enter_a_category_name">Please enter a category name</string>
|
||||||
<string name="failed_to_save_category">Failed to save category: %1$s</string>
|
<string name="failed_to_save_category">Failed to save category: %1$s</string>
|
||||||
|
<string name="instant_event_time">At: %1$s</string>
|
||||||
</resources>
|
</resources>
|
Loading…
Reference in a new issue