Skip to content

Commit

Permalink
[Track-303-3] RF handle last phase if it persists into month (#2482)
Browse files Browse the repository at this point in the history
  • Loading branch information
tolkamps1 authored Dec 12, 2024
1 parent 74d2962 commit a44119f
Showing 1 changed file with 4 additions and 0 deletions.
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

0 comments on commit a44119f

Please sign in to comment.