Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- First iteration (the latest entry in the table, id = 45 696):
- prev_ending_date = None (since this is the start of the loop)
- delta_days is not calculated, as there is no prev_ending_date
- min_start_date = 2024-01-05
- max_end_date = 2024-01-20
- prev_ending_date is set to 2024-01-20
- Second iteration (id = 45 603):
- prev_ending_date = 2024-01-20
- delta_days = 2023-10-31 - 2024-01-20 (a negative number, but we take this as a skip)
- min_start_date and max_end_date remain unchanged
- prev_ending_date is set to 2023-12-29
- Third iteration (id = 45 497):
- prev_ending_date = 2023-12-29
- delta_days = 2023-10-28 - 2023-12-29 (a negative number, we skip)
- min_start_date and max_end_date remain unchanged
- prev_ending_date is set to 2023-12-31
- Fourth iteration (id = 45 397):
- prev_ending_date = 2023-12-31
- Since the starting_date is the same as the previous entry, the results will be the same:
- delta_days = 2023-10-28 - 2023-12-31 (a negative number, we skip)
- min_start_date and max_end_date remain unchanged
- prev_ending_date remains 2023-12-31
- Fifth iteration (id = 45 319):
- prev_ending_date = 2023-12-14
- delta_days = 2023-10-30 - 2023-12-14 (this will be a negative number, but for the logic of the loop, we consider this as a skip)
- min_start_date remains presumably 2023-10-27
- max_end_date remains presumably 2024-01-21
- prev_ending_date is set to 2023-12-14
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement