Very very minor refactor, why even do this
This commit is contained in:
5
app.py
5
app.py
@@ -545,9 +545,6 @@ def generate_calendar_monthly_view(workouts, selected_date):
|
|||||||
"""
|
"""
|
||||||
Generate a monthly calendar view of the workouts.
|
Generate a monthly calendar view of the workouts.
|
||||||
"""
|
"""
|
||||||
def get_workout_for_date(workout_lookup, date):
|
|
||||||
return workout_lookup.get(date)
|
|
||||||
|
|
||||||
start_date, end_date = get_month_bounds(selected_date)
|
start_date, end_date = get_month_bounds(selected_date)
|
||||||
|
|
||||||
# Build a lookup dictionary for faster access
|
# Build a lookup dictionary for faster access
|
||||||
@@ -560,7 +557,7 @@ def generate_calendar_monthly_view(workouts, selected_date):
|
|||||||
'date': day,
|
'date': day,
|
||||||
'day_of_month': day.day,
|
'day_of_month': day.day,
|
||||||
'is_workout': day in workout_lookup,
|
'is_workout': day in workout_lookup,
|
||||||
'workout': get_workout_for_date(workout_lookup, day),
|
'workout': workout_lookup.get(day),
|
||||||
'is_current_date': day == current_date,
|
'is_current_date': day == current_date,
|
||||||
'is_current_month': day.month == selected_date.month and day.year == selected_date.year
|
'is_current_month': day.month == selected_date.month and day.year == selected_date.year
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user