Private
Public Access
1
0

addmanual added to menu

This commit is contained in:
Sander Roosendaal
2018-11-09 09:09:32 +01:00
parent 4301293665
commit a562fc3f64
5 changed files with 46 additions and 30 deletions

View File

@@ -400,12 +400,22 @@ def remove_rower_session(r,ps):
return 1
def get_dates_timeperiod(timeperiod,startdatestring='',enddatestring=''):
def get_dates_timeperiod(request,startdatestring='',enddatestring=''):
# set start end date according timeperiod
timeperiod = request.GET.get('when')
if not timeperiod:
timeperiod = 'thisweek'
startdatestring = request.GET.get('startdate')
enddatestring = request.GET.get('enddate')
if startdate and enddate:
startdate = dt.datetime.strptime(startdatestring,'%Y-%m-%d').date()
enddate = dt.datetime.strptime(enddatestring,'%Y-%m-%d').date()
return startdate,enddate
daterangetester = re.compile('^(\d+-\d+-\d+)\/(\d+-\d+-\d+)')
if timeperiod=='today':