diff --git a/src/App.js b/src/App.js index fc4bac6..5fddeb4 100644 --- a/src/App.js +++ b/src/App.js @@ -129,6 +129,18 @@ export default function App() { }} /> + +  () +

until {herdImmunityThresholdPercentage}% of the population is diff --git a/src/components/time-to-herd/time-to-herd.jsx b/src/components/time-to-herd/time-to-herd.jsx index 86d7c6a..f813840 100644 --- a/src/components/time-to-herd/time-to-herd.jsx +++ b/src/components/time-to-herd/time-to-herd.jsx @@ -2,6 +2,7 @@ import React, { useState, useEffect } from "react"; import CountUp from "react-countup"; import "./country-section.css"; import { CountriesMasterList } from "../../shared/data-factory.js"; +import moment from 'moment'; export const TimeToHerdCount = ({ selectedCountry, @@ -9,6 +10,7 @@ export const TimeToHerdCount = ({ requestedData, requestedDataAsPercent, herdImmunityThresholdPercentage, + addDays = false, }) => { const [ herdImmunityVaccinationThreshold, @@ -154,14 +156,17 @@ export const TimeToHerdCount = ({ return ( <> - {requestedDataAsPercent ? ( - - ) : ( - + {addDays ? + (moment().add(requestedDataValue, 'days').format("YYYY MMMM DD")) + : (requestedDataAsPercent ? ( + + ) : ( + + ) )} );