Commit a049e965 authored by Francesco Poldi's avatar Francesco Poldi

Fix output.checkDate

parent 3828732b
VERSION = (2, 1, 16) VERSION = (2, 1, 17)
__version__ = '.'.join(map(str, VERSION)) __version__ = '.'.join(map(str, VERSION))
...@@ -33,12 +33,18 @@ def clean_lists(): ...@@ -33,12 +33,18 @@ def clean_lists():
def datecheck(datetimestamp, config): def datecheck(datetimestamp, config):
logme.debug(__name__+':datecheck') logme.debug(__name__+':datecheck')
if config.Since and config.Until: if config.Since:
logme.debug(__name__+':datecheck:dateRangeTrue') logme.debug(__name__+':datecheck:SinceTrue')
d = int(datetime.strptime(datetimestamp, "%Y-%m-%d %H:%M:%S").timestamp()) d = int(datetime.strptime(datetimestamp, "%Y-%m-%d %H:%M:%S").timestamp())
s = int(datetime.strptime(config.Since, "%Y-%m-%d %H:%M:%S").timestamp()) s = int(datetime.strptime(config.Since, "%Y-%m-%d %H:%M:%S").timestamp())
if d < s: if d < s:
return False return False
if config.Until:
logme.debug(__name__+':datecheck:UntilTrue')
d = int(datetime.strptime(datetimestamp, "%Y-%m-%d %H:%M:%S").timestamp())
s = int(datetime.strptime(config.Until, "%Y-%m-%d %H:%M:%S").timestamp())
if d > s:
return False
logme.debug(__name__+':datecheck:dateRangeFalse') logme.debug(__name__+':datecheck:dateRangeFalse')
return True return True
......
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