show the age only if it contains a year

This commit is contained in:
tibbi 2021-05-18 16:24:55 +02:00
parent 169f81b78a
commit 2e11262b38

View file

@ -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})"
}