Commit cbde73a6 authored by Konstantin Tskhovrebov's avatar Konstantin Tskhovrebov 🤖

Merge branch 'fix/negative_note_time' into 'develop'

Fix negative humanTime

Closes #140

See merge request !186
parents d29d3c3d 4576c8ad
......@@ -42,7 +42,10 @@ fun Throwable.userMessage(resourceManager: ResourceManager) = when (this) {
private val DATE_FORMAT = DateTimeFormatter.ofPattern("dd MMM yyyy")
fun LocalDateTime.humanTime(resources: Resources): String {
val delta = Duration.between(this, LocalDateTime.now()).seconds
val delta = Duration.between(this, LocalDateTime.now())
.seconds
.let { maxOf(0, it) }
val timeStr =
when {
delta < 60 -> resources.getString(R.string.time_sec, delta)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment