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:
13
utils.py
13
utils.py
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user