Force period type to 'range' if date is a range when checking chart incomplete periods #18629
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.
Description:
As part of the recent Visual indication of incomplete periods on charts change (#18086), a check is performed on the currently selected period and date to determine if the period contains the current date. (eg. Period = 'week', Date = '2022-01-20'). This check is called by
jqplot.js
and executed by the periods service.The A/B testing plugin for some internal reason needs to set the period to 'day' but the date to a range (eg. '2021-01-20,2021-01-27). This causes the
containsToday
check to fail as a valid date cannot be parsed from a date range.This PR adds a simple check before calling attempting to parse the date period, if the date is a range then the period type will be forced to type 'range' for the purposes of the
containsToday
check only.Ref L3-205
Review