-
Notifications
You must be signed in to change notification settings - Fork 31
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
fix: Partial holidays range breaks #2297
fix: Partial holidays range breaks #2297
Conversation
mofojed
commented
Nov 18, 2024
- Partial holidays were not generating valid range breaks, as they did not account for business periods specified on the calendar
- Essentially we were adding another "closed" period that overlapped with time that was already outside of regular business hours
- Added a ticket to plotly.js to take into account range breaks which may overlap: Plot does not appear in some cases if rangebreaks overlap plotly/plotly.js#7270, as that would be nice to handle on their end, but this should be sufficient to resolve from our end
- Needed for DH-16016
- Added a bunch of test cases
- Partial holidays were not generating valid range breaks, as they did not account for business periods specified on the calendar - Added a bunch of test cases
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2297 +/- ##
==========================================
+ Coverage 46.60% 46.68% +0.07%
==========================================
Files 704 704
Lines 38963 39011 +48
Branches 9914 9926 +12
==========================================
+ Hits 18158 18211 +53
+ Misses 20794 20746 -48
- Partials 11 54 +43
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
packages/chart/src/ChartUtils.ts
Outdated
for (let i = 0; i < weekLength; i += 1) { | ||
if ( | ||
!businessDaysSet.has(i) && | ||
businessDaysSet.has((i - 1) % weekLength) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this work when businessDaysSet has all days except 0?
(i - 1) % weekLength
is out of bounds for i = 0.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ohhh great catch! No it does not, I'll fix up.
Co-authored-by: Vlad Babich <vladimir.babich@gmail.com>
- Had an off by 1 error when calculating the business days