From 6171ea978567c749182ea357cf52d44be4064ab6 Mon Sep 17 00:00:00 2001 From: Rool Paap Date: Fri, 4 Nov 2022 08:53:08 +0100 Subject: [PATCH] 5016: Show test date --- .../Event/List/ListRemoteEventsViewModel+ViewState.swift | 8 ++++++++ .../StoredEvents/List/ListStoredEventsViewModel.swift | 8 ++++---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/Sources/CTR/Interface/Holder/Event/List/ListRemoteEventsViewModel+ViewState.swift b/Sources/CTR/Interface/Holder/Event/List/ListRemoteEventsViewModel+ViewState.swift index bf7ebf05a..9822b4b76 100644 --- a/Sources/CTR/Interface/Holder/Event/List/ListRemoteEventsViewModel+ViewState.swift +++ b/Sources/CTR/Interface/Holder/Event/List/ListRemoteEventsViewModel+ViewState.swift @@ -433,10 +433,14 @@ extension ListRemoteEventsViewModel { let formattedBirthDate: String = dataRow.identity.birthDateString .flatMap(Formatter.getDateFrom) .map(DateFormatter.Format.dayMonthYear.string) ?? (dataRow.identity.birthDateString ?? "") + + let formattedTestDate: String = Formatter.getDateFrom(dateString8601: recovery.firstPositiveTestDate) + .map(DateFormatter.Format.dayMonthYear.string) ?? recovery.firstPositiveTestDate return ListRemoteEventsViewController.Row( title: L.general_recoverycertificate().capitalizingFirstLetter(), details: [ + L.holder_listRemoteEvents_listElement_testDate(formattedTestDate), L.holder_listRemoteEvents_listElement_name(dataRow.identity.fullName), L.holder_listRemoteEvents_listElement_birthDate(formattedBirthDate) ], @@ -460,10 +464,14 @@ extension ListRemoteEventsViewModel { let formattedBirthDate: String = dataRow.identity.birthDateString .flatMap(Formatter.getDateFrom) .map(DateFormatter.Format.dayMonthYear.string) ?? (dataRow.identity.birthDateString ?? "") + + let formattedTestDate: String = Formatter.getDateFrom(dateString8601: test.sampleDate) + .map(DateFormatter.Format.dayMonthYear.string) ?? test.sampleDate return ListRemoteEventsViewController.Row( title: L.general_testcertificate().capitalizingFirstLetter(), details: [ + L.holder_listRemoteEvents_listElement_testDate(formattedTestDate), L.holder_listRemoteEvents_listElement_name(dataRow.identity.fullName), L.holder_listRemoteEvents_listElement_birthDate(formattedBirthDate) ], diff --git a/Sources/CTR/Interface/Holder/StoredEvents/List/ListStoredEventsViewModel.swift b/Sources/CTR/Interface/Holder/StoredEvents/List/ListStoredEventsViewModel.swift index b03a10d55..f82e389bb 100644 --- a/Sources/CTR/Interface/Holder/StoredEvents/List/ListStoredEventsViewModel.swift +++ b/Sources/CTR/Interface/Holder/StoredEvents/List/ListStoredEventsViewModel.swift @@ -248,12 +248,12 @@ class ListStoredEventsViewModel { private func getRowFromRecoveryDCC(_ recovery: EuCredentialAttributes.RecoveryEntry, identity: EventFlow.Identity) -> ListStoredEventsViewController.Row { - let formattedVaccinationDate: String = Formatter.getDateFrom(dateString8601: recovery.firstPositiveTestDate) + let formattedTestDate: String = Formatter.getDateFrom(dateString8601: recovery.firstPositiveTestDate) .map(DateFormatter.Format.dayMonthYear.string) ?? recovery.firstPositiveTestDate return ListStoredEventsViewController.Row( title: L.general_recoverycertificate().capitalizingFirstLetter(), - details: formattedVaccinationDate, + details: formattedTestDate, action: { [weak self] in self?.coordinator?.userWishesToSeeEventDetails( L.general_recoverycertificate().capitalizingFirstLetter(), @@ -265,12 +265,12 @@ class ListStoredEventsViewModel { private func getRowFromNegativeTestDCC(_ test: EuCredentialAttributes.TestEntry, identity: EventFlow.Identity) -> ListStoredEventsViewController.Row { - let formattedVaccinationDate: String = Formatter.getDateFrom(dateString8601: test.sampleDate) + let formattedTestDate: String = Formatter.getDateFrom(dateString8601: test.sampleDate) .map(DateFormatter.Format.dayMonthYear.string) ?? test.sampleDate return ListStoredEventsViewController.Row( title: L.general_negativeTest().capitalizingFirstLetter(), - details: formattedVaccinationDate, + details: formattedTestDate, action: { [weak self] in self?.coordinator?.userWishesToSeeEventDetails( L.general_negativeTest().capitalizingFirstLetter(),