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 { ...@@ -22,20 +22,36 @@ fun StatsItem.getPrimaryLabel(context: Context): String {
val dateTimeFormatter = DateTimeFormat.mediumDate().withLocale(context.getLocale()) val dateTimeFormatter = DateTimeFormat.mediumDate().withLocale(context.getLocale())
return when (this) { 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) { is KeySubmissionsStats -> when (updatedAtDate) {
today -> context.getString(R.string.statistics_primary_value_today) today -> context.getString(R.string.statistics_primary_value_today)
yesterday -> context.getString(R.string.statistics_primary_value_yesterday) yesterday -> context.getString(R.string.statistics_primary_value_yesterday)
else -> dateTimeFormatter.print(updatedAtDate) else -> dateTimeFormatter.print(updatedAtDate)
} }
is IncidenceStats, is IncidenceStats -> when (updatedAtDate) {
is PersonsVaccinatedOnceStats, today -> context.getString(R.string.statistics_primary_value_until_today)
is PersonsVaccinatedCompletelyStats, yesterday -> context.getString(R.string.statistics_primary_value_until_yesterday)
is AppliedVaccinationRatesStats -> when (updatedAtDate) { 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) today -> context.getString(R.string.statistics_primary_value_until_today)
yesterday -> context.getString(R.string.statistics_primary_value_until_yesterday) yesterday -> context.getString(R.string.statistics_primary_value_until_yesterday)
else -> context.getString(R.string.statistics_primary_value_until, dateTimeFormatter.print(updatedAtDate)) 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) { is SevenDayRValue -> when (updatedAtDate) {
today -> context.getString(R.string.statistics_primary_value_current) today -> context.getString(R.string.statistics_primary_value_current)
yesterday -> context.getString(R.string.statistics_primary_value_yesterday) 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