Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Force period type to 'range' if date is a range when checking chart incomplete periods #18629

Merged
merged 3 commits into from Jan 17, 2022

Conversation

bx80
Copy link
Contributor

@bx80 bx80 commented Jan 15, 2022

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

@bx80 bx80 added Bug For errors / faults / flaws / inconsistencies etc. Needs Review PRs that need a code review labels Jan 15, 2022
@bx80 bx80 added this to the 4.7.0 milestone Jan 15, 2022
@bx80 bx80 self-assigned this Jan 15, 2022
Copy link
Contributor

@justinvelluppillai justinvelluppillai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just one minor fix otherwise looks good to me (pending tests passing).

@bx80 bx80 removed the request for review from AltamashShaikh January 17, 2022 00:56
@bx80 bx80 removed the Needs Review PRs that need a code review label Jan 17, 2022
@bx80 bx80 merged commit 104b6f6 into 4.x-dev Jan 17, 2022
@bx80 bx80 deleted the l3-205-day-period-parse-error branch January 17, 2022 00:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug For errors / faults / flaws / inconsistencies etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants