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

[Track-303-3] RF handle last phase if it persists into month #2482

Merged
merged 1 commit into from
Dec 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions epictrack-api/src/api/reports/resource_forecast_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -439,6 +439,10 @@ def _update_month_labels(self, works, start_events):
phase_end = event["phase_end"].date()
if phase_start <= month_end and phase_end >= month_start:
if phase_end.month == month_start.month and 1 <= phase_end.day <= 14:
# If this is the last phase show it as long as it persists at least 5 days into the month
if event == sorted_events[-1] and phase_end.day > 4:
event_to_show = event
break
# Show the next phase if the phase ends in the early part of the month
next_event = next(
(e for e in sorted_events if e["phase_start"].date() > phase_end),
Expand Down