remove timezone offsetting from date range methods #2703
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.
Summary
This is to fix DateRangeUtilsTest which fails in certain timezones.
The date range method
parseHumanReadableDate
is used in case search date range widget to convert a text date range like12-07-2023 to 14-07-2023
to time in milliseconds to set the range to the date widget. This method currently offsets the time in milliseconds for the current timezone. That doesn't seem correct to me as that can lead to dates being different on date widget in comparison to what is provided in the String. Instead we should just be returning the dates in current time zone so that they are consistent between their string manipulation and date widget.This method itself was added in this PR for context and I can't seem to remember why I decided to offset the timezone earlier.
Feature Flag
CASE_SEARCH
Safety Assurance
Automated test coverage
Change itself is to fix a test
Safety story
Change is Limited to date range widget used in case search
QA note: Check for date range widget in case search working correctly across a few different timezones.