Private
Public Access
1
0

adding past 12 months

This commit is contained in:
Sander Roosendaal
2020-05-10 13:35:27 +02:00
parent e60c6373f8
commit 45ffeb76ee
2 changed files with 6 additions and 0 deletions

View File

@@ -37,6 +37,8 @@
<a href="/rowers/history/?enddate={{ today|date:"Y-m-d" }}&startdate={{ last28|date:"Y-m-d" }}&workouttype={{ workouttype }}">Past 28 days</a>
&nbsp;
<a href="/rowers/history/?enddate={{ today|date:"Y-m-d" }}&startdate={{ firstmay|date:"Y-m-d" }}&workouttype={{ workouttype }}">Current Concept2 Season</a>
&nbsp;
<a href="/rowers/history/?enddate={{ today|date:"Y-m-d" }}&startdate={{ lastyear|date:"Y-m-d" }}&workouttype={{ workouttype }}">Past 12 months</a>
</li>
<li class="grid_2">
<p>

View File

@@ -4763,8 +4763,11 @@ def history_view(request,userid=0):
lastseven = timezone.now()-datetime.timedelta(days=7)
lastfourteen = timezone.now()-datetime.timedelta(days=14)
last28 = timezone.now()-datetime.timedelta(days=28)
today = timezone.now()
lastyear = datetime.datetime(year=today.year-1,month=today.month,day=today.day)
firstmay = datetime.datetime(year=today.year,month=5,day=1).astimezone(usertimezone)
if firstmay>today:
firstmay = datetime.datetime(year=today.year-1,month=5,day=1)
@@ -4786,6 +4789,7 @@ def history_view(request,userid=0):
'lastseven':lastseven,
'lastfourteen':lastfourteen,
'last28':last28,
'lastyear':lastyear,
'today':today,
'workouttype':typeselect,
'firstmay':firstmay,