Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Background
This PR fixes the two issues described in the ticket: https://dhis2.atlassian.net/browse/DHIS2-18087
Analytics relative time
Updates to use useTimeZoneConversion hook to correct for time zone. This information appears when you retrieve data results for an exchange.
(Note here I looked at the exchange 10 minutes after running analytics, so it was about 13:50 and analytics was run at 13:40, but I set my computer time zone to Washington DC)
Before
After
Ambiguous dates in exchange cards
Changes to format based on the specified system dateFormat (
yyyy-mm-dd
ordd-mm-yyyy
). This information appears on the overview page when editing configurations.Before
After
Testing
I've tested this manually (for time zone, I've changed my time zone locally). I've also added some automatic tests. I altered the overall high-level test to check for the date stamp in the exchange cards and then added a lower-level test to check that the dates appear correct based on the system dateFormat + the given date. I've also kept the tests for the time zone correction for analytics time stamp at a lower level as we were already checking for the text generally.