Commit 042e25f0 authored by Oscar Roisin's avatar Oscar Roisin

fix date in period function

parent 945531b3
......@@ -16,14 +16,14 @@ def getDatasForPeriod(startPeriod, endPeriod, indicators):
return datas
def verifyDateInPeriod(startPeriod, endPeriod, year, month, day):
isDate = year.isdigit() AND month.isdigit() AND day.isdigit()
isDate = year.isdigit() and month.isdigit() and day.isdigit()
if isDate:
date = datetime.strptime(year + "-" + month + "-" + day, "%Y-%m-%d")
dateStart = datetime.strptime(startPeriod, "%Y-%m-%d")
dateEnd = datetime.strptime(endPeriod, "%Y-%m-%d")
if date >= dateStart and date <= dateEnd:
return True
return False
return False
def getDecileForAllStations(startPeriod, endPeriod, table, nb_indicators, indicators_list):
# map with station and list of maps
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment