fixed datetime parser

This commit is contained in:
rugantio 2019-01-29 22:26:01 +01:00
parent b06883dc3c
commit 17430a06a9
4 changed files with 6 additions and 3 deletions

3
.gitignore vendored
View File

@ -1 +1,4 @@
**/__pycache__/
.*
!.gitignore

1
.~lock.trump.csv# Normal file
View File

@ -0,0 +1 @@
,rugantio,alice,29.01.2019 22:19,file:///home/rugantio/.config/libreoffice/4;

View File

@ -74,9 +74,8 @@ def parse_date(date):
if len(date) == 0:
return 'Error: no data'
#no check for today
#elif len(date) == 1 or date[1] == 'h':
#pass
elif len(date) == 2 and date[1] == 'h' and int(str(datetime.now().time()).split(sep=':')[0]) - int(date[0]) >= 0:
pass
#yesterday
elif date[0] == 'Ieri' or (date[1] == 'h' and int(str(datetime.now().time()).split(sep=':')[0]) - int(date[0]) < 0):