Commit 4b52132f authored by Oscar Roisin's avatar Oscar Roisin
Browse files

update date verification

parent 248fecd3
......@@ -16,13 +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()
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 or date > dateEnd:
return False
if date >= dateStart and date <= dateEnd:
return True
return False
def getDecileForAllStations(startPeriod, endPeriod, table, nb_indicators, indicators_list):
# map with station and list of maps
Supports Markdown
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