forked from expo/troggle
2019 logbook error fix
This commit is contained in:
parent
278a84a485
commit
91c9cf0c31
@ -182,7 +182,7 @@ def ParseDate(tripdate, year):
|
|||||||
message = f" ! - Bad date (year) in logbook: {tripdate} - {year}"
|
message = f" ! - Bad date (year) in logbook: {tripdate} - {year}"
|
||||||
DataIssue.objects.create(parser='logbooks', message=message)
|
DataIssue.objects.create(parser='logbooks', message=message)
|
||||||
logdataissues["tripdate"]=message
|
logdataissues["tripdate"]=message
|
||||||
return datetime.date('1970', '01', '01')
|
return datetime.date(1970, 1, 1)
|
||||||
else:
|
else:
|
||||||
year, month, day = int(mdatestandard.group(1)), int(mdatestandard.group(2)), int(mdatestandard.group(3))
|
year, month, day = int(mdatestandard.group(1)), int(mdatestandard.group(2)), int(mdatestandard.group(3))
|
||||||
elif mdategoof:
|
elif mdategoof:
|
||||||
@ -190,7 +190,7 @@ def ParseDate(tripdate, year):
|
|||||||
message = " ! - Bad date mdategoof.group(3) in logbook: " + tripdate + " - " + mdategoof.group(3)
|
message = " ! - Bad date mdategoof.group(3) in logbook: " + tripdate + " - " + mdategoof.group(3)
|
||||||
DataIssue.objects.create(parser='logbooks', message=message)
|
DataIssue.objects.create(parser='logbooks', message=message)
|
||||||
logdataissues["tripdate"]=message
|
logdataissues["tripdate"]=message
|
||||||
return date('1970', '01', '01')
|
return datetime.date(1970, 1, 1)
|
||||||
else:
|
else:
|
||||||
yadd = int(year[:2]) * 100
|
yadd = int(year[:2]) * 100
|
||||||
day, month, year = int(mdategoof.group(1)), int(mdategoof.group(2)), int(mdategoof.group(4)) + yadd
|
day, month, year = int(mdategoof.group(1)), int(mdategoof.group(2)), int(mdategoof.group(4)) + yadd
|
||||||
@ -204,7 +204,7 @@ def ParseDate(tripdate, year):
|
|||||||
message = f" ! - Failed to parse date in logbook: {tripdate} - {year}"
|
message = f" ! - Failed to parse date in logbook: {tripdate} - {year}"
|
||||||
DataIssue.objects.create(parser='logbooks', message=message)
|
DataIssue.objects.create(parser='logbooks', message=message)
|
||||||
logdataissues["tripdate"]=message
|
logdataissues["tripdate"]=message
|
||||||
return date('1970', '01', '01')
|
return datetime.date(1970, 1, 1)
|
||||||
|
|
||||||
# (2006 - not any more), 2008 - 2009
|
# (2006 - not any more), 2008 - 2009
|
||||||
def Parselogwikitxt(year, expedition, txt):
|
def Parselogwikitxt(year, expedition, txt):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user