Fixed document date parsing. * Closes #57.
h3rald h3rald@h3rald.com
Sat, 21 Apr 2018 13:11:51 +0200
2 files changed,
2 insertions(+),
1 deletions(-)
M
hastyscribe.nim
→
hastyscribe.nim
@@ -380,6 +380,7 @@
# Date parsing and validation var timeinfo: DateTime = local(getTime()) + if parse_date(metadata.date, timeinfo) == false: discard parse_date(getDateStr(), timeinfo)
M
lib/utils.nim
→
lib/utils.nim
@@ -19,7 +19,7 @@ )
if parts.len < 3: return false try: - timeinfo = DateTime(year: parts[0], month: Month(parts[1]-1), monthday: parts[2]) + timeinfo = DateTime(year: parts[0], month: Month(parts[1]), monthday: parts[2]) # Fix invalid dates (e.g. Feb 31st -> Mar 3rd) timeinfo = local(timeinfo.toTime); return true