Swtich from person list to new overview page

This commit is contained in:
Peter Stockings
2025-01-27 01:17:23 +11:00
parent 0ed0c20e93
commit 6b741e50d0
7 changed files with 8 additions and 256 deletions

View File

@@ -127,29 +127,6 @@ def convert_str_to_date(date_str, format='%Y-%m-%d'):
return None
def get_earliest_and_latest_workout_date(person):
workouts = person.get('Workouts', [])
if workouts:
# Initialize earliest and latest dates with the first workout's start date
earliest_date = latest_date = workouts[0]['StartDate']
for workout in workouts[1:]:
date = workout['StartDate']
if date < earliest_date:
earliest_date = date
if date > latest_date:
latest_date = date
return (earliest_date, latest_date)
# Return the current date for both if no workouts are present
current_date = datetime.now().date()
return (current_date, current_date)
def filter_workout_topsets(workout, selected_exercise_ids):
workout['TopSets'] = [topset for topset in workout['TopSets']
if topset['ExerciseId'] in selected_exercise_ids]
return workout
def flatten_list(list_of_lists):
return [item for sublist in list_of_lists for item in sublist]