From 2e11262b38ab42cf716b64b748e6ddf9e91c519d Mon Sep 17 00:00:00 2001 From: tibbi Date: Tue, 18 May 2021 16:24:55 +0200 Subject: [PATCH] show the age only if it contains a year --- .../kotlin/com/simplemobiletools/commons/extensions/String.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/commons/src/main/kotlin/com/simplemobiletools/commons/extensions/String.kt b/commons/src/main/kotlin/com/simplemobiletools/commons/extensions/String.kt index 5412f8d24..c0cd66109 100644 --- a/commons/src/main/kotlin/com/simplemobiletools/commons/extensions/String.kt +++ b/commons/src/main/kotlin/com/simplemobiletools/commons/extensions/String.kt @@ -256,7 +256,7 @@ fun String.getDateTimeFromDateString(showYearsSince: Boolean, viewToUpdate: Text } var formattedString = date.toString(localPattern) - if (showYearsSince) { + if (showYearsSince && hasYear) { formattedString += " (${Years.yearsBetween(date, DateTime.now()).years})" }