mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-04-20 22:23:37 +00:00
fix: ContactItem background color inconsistency
This commit is contained in:
parent
d7013e1386
commit
d4f4e4f14a
2 changed files with 60 additions and 56 deletions
|
|
@ -33,7 +33,7 @@ data class Contact(
|
|||
val isMuted: Boolean,
|
||||
)
|
||||
|
||||
// return time if within 24 hours, otherwise date/time
|
||||
// return time if within 24 hours, otherwise date
|
||||
internal fun getShortDateTime(time: Long): String? {
|
||||
val date = if (time != 0L) Date(time) else return null
|
||||
val isWithin24Hours = System.currentTimeMillis() - date.time <= 24 * 60 * 60 * 1000L
|
||||
|
|
@ -41,7 +41,7 @@ internal fun getShortDateTime(time: Long): String? {
|
|||
return if (isWithin24Hours) {
|
||||
DateFormat.getTimeInstance(DateFormat.SHORT).format(date)
|
||||
} else {
|
||||
DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.SHORT).format(date)
|
||||
DateFormat.getDateInstance(DateFormat.SHORT).format(date)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue