From 28fb6bd0f4380e595e8be182d52eea9f56ca85cc Mon Sep 17 00:00:00 2001 From: MN <97020799+VWSCoronaDashboard24@users.noreply.github.com> Date: Thu, 28 Apr 2022 11:29:08 +0200 Subject: [PATCH] Fix/vaccine coverage date (#4207) * fix: use date_unix for vaccine coverage data * fix: use date_unix instead of date_end_unix for vaccine coverage chart Co-authored-by: VWSCoronaDashboard24 --- packages/app/schema/nl/vaccine_coverage.json | 4 ++++ .../app/src/domain/vaccine/vaccinations-over-time-tile.tsx | 2 +- packages/common/src/types/data.ts | 1 + 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/app/schema/nl/vaccine_coverage.json b/packages/app/schema/nl/vaccine_coverage.json index ac3177180b..f8395e508a 100644 --- a/packages/app/schema/nl/vaccine_coverage.json +++ b/packages/app/schema/nl/vaccine_coverage.json @@ -10,6 +10,7 @@ "partially_or_fully_vaccinated", "date_start_unix", "date_end_unix", + "date_unix", "date_of_insertion_unix" ], "additionalProperties": false, @@ -32,6 +33,9 @@ "date_end_unix": { "type": "integer" }, + "date_unix": { + "type": "integer" + }, "date_of_insertion_unix": { "type": "integer" } diff --git a/packages/app/src/domain/vaccine/vaccinations-over-time-tile.tsx b/packages/app/src/domain/vaccine/vaccinations-over-time-tile.tsx index 5ab0f01bc9..16e702c2a0 100644 --- a/packages/app/src/domain/vaccine/vaccinations-over-time-tile.tsx +++ b/packages/app/src/domain/vaccine/vaccinations-over-time-tile.tsx @@ -69,7 +69,7 @@ export function VaccinationsOverTimeTile(props: VaccinationsOverTimeTileProps) { const lastDate = useMemo( () => activeVaccinationChart === 'coverage' && isDefined(coverageData) - ? coverageData.last_value.date_end_unix + ? coverageData.last_value.date_unix : administrationData.last_value.date_end_unix, [ activeVaccinationChart, diff --git a/packages/common/src/types/data.ts b/packages/common/src/types/data.ts index 5015cf8501..62bf4e375a 100644 --- a/packages/common/src/types/data.ts +++ b/packages/common/src/types/data.ts @@ -927,6 +927,7 @@ export interface NlVaccineCoverageValue { partially_or_fully_vaccinated: number; date_start_unix: number; date_end_unix: number; + date_unix: number; date_of_insertion_unix: number; } export interface NlVaccineDeliveryEstimate {