diff --git a/src/views/CT/ViralLoad/ViralLoad.js b/src/views/CT/ViralLoad/ViralLoad.js index 804c2abe..3695862a 100644 --- a/src/views/CT/ViralLoad/ViralLoad.js +++ b/src/views/CT/ViralLoad/ViralLoad.js @@ -126,7 +126,7 @@ const ViralLoad = () => { toggle('undetectable_untransmittable'); }} > - {`UNDETECTABLE=UNTRAMITTABLE (U=U)`} + {`UNDETECTABLE=UNTRANSMITTABLE (U=U)`} diff --git a/src/views/CT/ViralLoad/ViralLoadU_U.js b/src/views/CT/ViralLoad/ViralLoadU_U.js index bf29b23e..b9c7cde3 100644 --- a/src/views/CT/ViralLoad/ViralLoadU_U.js +++ b/src/views/CT/ViralLoad/ViralLoadU_U.js @@ -14,7 +14,7 @@ const ViralLoadU_U = () => { return ( <> - + { // const currentOnArt = useSelector( // currentOnArtOverviewSelectors.getCurrentOnArt // ); - + const currentDate = moment(); + + // Check if the current date is before the 20th of the month + if (currentDate.date() < 20) { + // If true, subtract 2 months + currentDate.subtract(2, 'months'); + } else { + // If false, subtract 1 month + currentDate.subtract(1, 'months'); + } + // Format the date + const reporting_month = currentDate.format('MMM YYYY'); + const currentOnArt = useSelector(currentOnArtSelectors.getCurrentOnArt); - const currentOnArtText = - 'CURRENT ON ART as at ' + - moment().subtract(2, 'month').add(20, 'days').format('MMM YYYY'); + const currentOnArtText = 'CURRENT ON ART as at ' + reporting_month; const eligibleForVl = useSelector( currentOnArtOverviewSelectors.getEligibleForVl );