mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-04-20 22:23:37 +00:00
fix: contact placeholder date when time is zero
This commit is contained in:
parent
be445d7ed7
commit
6526c91f3a
1 changed files with 2 additions and 2 deletions
|
|
@ -143,8 +143,8 @@ data class Contact(
|
|||
)
|
||||
|
||||
// return time if within 24 hours, otherwise date
|
||||
private fun getShortDate(time: Long): String {
|
||||
val date = Date(time)
|
||||
private fun getShortDate(time: Long): String? {
|
||||
val date = if (time != 0L) Date(time) else return null
|
||||
val isWithin24Hours = System.currentTimeMillis() - date.time <= TimeUnit.DAYS.toMillis(1)
|
||||
|
||||
return if (isWithin24Hours) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue