Skip to content
Snippets Groups Projects
Unverified Commit 1c14bda4 authored by axelherbstreith's avatar axelherbstreith Committed by GitHub
Browse files

Fix Statistic Card Label (DEV) (#3503)


* udapted labels

* added handling

* update incidence label

* fix test

* lint

Co-authored-by: default avatarBMItter <Berndus@gmx.de>
Co-authored-by: default avatarMohamed Metwalli <mohamed.metwalli@sap.com>
parent b268937d
No related branches found
No related tags found
No related merge requests found
......@@ -22,20 +22,36 @@ fun StatsItem.getPrimaryLabel(context: Context): String {
val dateTimeFormatter = DateTimeFormat.mediumDate().withLocale(context.getLocale())
return when (this) {
is InfectionStats,
is InfectionStats -> when (updatedAtDate) {
today -> context.getString(R.string.statistics_primary_value_today)
yesterday -> context.getString(R.string.statistics_primary_value_yesterday)
else -> dateTimeFormatter.print(updatedAtDate)
}
is KeySubmissionsStats -> when (updatedAtDate) {
today -> context.getString(R.string.statistics_primary_value_today)
yesterday -> context.getString(R.string.statistics_primary_value_yesterday)
else -> dateTimeFormatter.print(updatedAtDate)
}
is IncidenceStats,
is PersonsVaccinatedOnceStats,
is PersonsVaccinatedCompletelyStats,
is AppliedVaccinationRatesStats -> when (updatedAtDate) {
is IncidenceStats -> when (updatedAtDate) {
today -> context.getString(R.string.statistics_primary_value_until_today)
yesterday -> context.getString(R.string.statistics_primary_value_until_yesterday)
else -> context.getString(R.string.statistics_primary_value_until, dateTimeFormatter.print(updatedAtDate))
}
is PersonsVaccinatedOnceStats -> when (updatedAtDate) {
today -> context.getString(R.string.statistics_primary_value_until_today)
yesterday -> context.getString(R.string.statistics_primary_value_until_yesterday)
else -> context.getString(R.string.statistics_primary_value_until, dateTimeFormatter.print(updatedAtDate))
}
is PersonsVaccinatedCompletelyStats -> when (updatedAtDate) {
today -> context.getString(R.string.statistics_primary_value_until_today)
yesterday -> context.getString(R.string.statistics_primary_value_until_yesterday)
else -> context.getString(R.string.statistics_primary_value_until, dateTimeFormatter.print(updatedAtDate))
}
is AppliedVaccinationRatesStats -> when (updatedAtDate) {
today -> context.getString(R.string.statistics_primary_value_today)
yesterday -> context.getString(R.string.statistics_primary_value_yesterday)
else -> dateTimeFormatter.print(updatedAtDate)
}
is SevenDayRValue -> when (updatedAtDate) {
today -> context.getString(R.string.statistics_primary_value_current)
yesterday -> context.getString(R.string.statistics_primary_value_yesterday)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment