package de.haushalt.app.ui.task

import java.time.LocalDate
import java.time.format.DateTimeFormatter

private val germanFormatter = DateTimeFormatter.ofPattern("dd.MM.yyyy")

fun formatDate(iso: String): String = try {
    LocalDate.parse(iso.take(10)).format(germanFormatter)
} catch (e: Exception) {
    iso
}
