Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Simon Bazin
nf26-metar
Commits
4b52132f
Commit
4b52132f
authored
Jun 22, 2019
by
Oscar Roisin
Browse files
update date verification
parent
248fecd3
Changes
1
Hide whitespace changes
Inline
Side-by-side
kmeans.py
View file @
4b52132f
...
...
@@ -16,13 +16,14 @@ def getDatasForPeriod(startPeriod, endPeriod, indicators):
return
datas
def
verifyDateInPeriod
(
startPeriod
,
endPeriod
,
year
,
month
,
day
):
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
return
True
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
def
getDecileForAllStations
(
startPeriod
,
endPeriod
,
table
,
nb_indicators
,
indicators_list
):
# map with station and list of maps
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment