Add min/max filter filter for exercise sparkline graph

This commit is contained in:
Peter Stockings
2024-07-29 21:27:30 +10:00
parent 73c1e115bb
commit 1384eb007b
4 changed files with 91 additions and 5 deletions

3
app.py
View File

@@ -418,6 +418,9 @@ def get_exercise_progress_for_user(person_id, exercise_id):
'max_date'), '%Y-%m-%d')
epoch = request.args.get('epoch', default='All')
if epoch == 'Custom' and (min_date is None or max_date is None):
(min_date, max_date) = db.get_exercise_earliest_and_latest_dates(person_id, exercise_id)
exercise_progress = db.get_exercise_progress_for_user(person_id, exercise_id, min_date, max_date, epoch)
if not exercise_progress: