WIP: Add graphs to workouts list view that show reps/weight, still need to refactor logic and dont display unless plot button(Need to add) is checked

This commit is contained in:
Peter Stockings
2023-04-02 22:36:30 +10:00
parent b128b7fb24
commit c4bd430eaf
3 changed files with 83 additions and 1 deletions

View File

@@ -170,3 +170,16 @@ def first_and_last_visible_days_in_month(first_day_of_month, last_day_of_month):
end_date = last_day_of_month + \
timedelta(days=end[last_day_of_month.weekday()])
return (start_date, end_date)
def flatten(lst):
"""
Flatten a list of lists.
"""
result = []
for item in lst:
if isinstance(item, list):
result.extend(flatten(item))
else:
result.append(item)
return result