|
22 | 22 |
|
23 | 23 | def merge_date_ranges(date_range_list): |
24 | 24 | """ |
25 | | - Given a list of date ranges (using the defined namedtuple "Range"), combine overlapping date ranges |
26 | | - While adjacent fiscal years do not overlap the desired behavior is to combine them |
27 | | - FY2010 ends on 2010-09-30, FY2011 start on 2010-10-01. |
28 | | - To address this, when comparing ranges 1 day is removed from the start date and 1 day is added to the end date |
29 | | - Then the overlapping ranges must be > 1 instead of > 0 |
30 | | - Inspired by Raymond Hettinger [https://stackoverflow.com/a/9044111] |
| 25 | + Given a list of date ranges (using the defined namedtuple "Range"), combine overlapping date ranges |
| 26 | + While adjacent fiscal years do not overlap the desired behavior is to combine them |
| 27 | + FY2010 ends on 2010-09-30, FY2011 start on 2010-10-01. |
| 28 | + To address this, when comparing ranges 1 day is removed from the start date and 1 day is added to the end date |
| 29 | + Then the overlapping ranges must be > 1 instead of > 0 |
| 30 | + Inspired by Raymond Hettinger [https://stackoverflow.com/a/9044111] |
31 | 31 | """ |
32 | 32 | ordered_list = sorted([sorted(t) for t in date_range_list]) |
33 | 33 | saved_range = Range(start=ordered_list[0][0], end=ordered_list[0][1]) |
@@ -142,7 +142,7 @@ def total_obligation_queryset(amount_obj, model, filters): |
142 | 142 |
|
143 | 143 | def can_use_month_aggregation(time_period): |
144 | 144 | """ |
145 | | - time_period is the list of action_date ranges from API |
| 145 | + time_period is the list of action_date ranges from API |
146 | 146 | """ |
147 | 147 | try: |
148 | 148 | for v in time_period: |
@@ -173,7 +173,7 @@ def can_use_total_obligation_enum(amount_obj): |
173 | 173 |
|
174 | 174 | def only_action_date_type(time_period): |
175 | 175 | """ |
176 | | - if a date_type is last_modified_date, don't use the matview this applies to |
| 176 | + if a date_type is last_modified_date, don't use the matview this applies to |
177 | 177 | """ |
178 | 178 | try: |
179 | 179 | for v in time_period: |
|
0 commit comments