On hover of exercise progress sparkline on new workout modal, show estimated 1rm and date of workout as a popover

This commit is contained in:
Peter Stockings
2023-12-07 20:50:59 +11:00
parent 469054048e
commit 3fca116d1c
3 changed files with 15 additions and 10 deletions

5
db.py
View File

@@ -489,4 +489,7 @@ class DataBase():
estimated_1rm = [t['estimated_1rm'] for t in topsets]
# Get a list of all start_dates
start_dates = [t['start_date'] for t in topsets]
return (estimated_1rm, start_dates)
# Create a list of messages with the structure 'estimated_1rm kg on start_date' with start_date formatted as 'dd/mm/yyyy'
messages = [f'{t["estimated_1rm"]}kg on {t["start_date"].strftime("%d/%m/%Y")}' for t in topsets]
return (estimated_1rm, start_dates, messages)