Assumes no DST in case of ambiguous dates

Fixes #153
This commit is contained in:
Manuel Ebert 2014-04-16 14:25:56 -04:00
parent 6da4e44e39
commit 414acf2ae6

View file

@ -338,7 +338,7 @@ class DayOne(Journal):
except (KeyError, pytz.exceptions.UnknownTimeZoneError): except (KeyError, pytz.exceptions.UnknownTimeZoneError):
timezone = tzlocal.get_localzone() timezone = tzlocal.get_localzone()
date = dict_entry['Creation Date'] date = dict_entry['Creation Date']
date = date + timezone.utcoffset(date) date = date + timezone.utcoffset(date, is_dst=False)
raw = dict_entry['Entry Text'] raw = dict_entry['Entry Text']
sep = re.search("[\n!?.]+", raw) sep = re.search("[\n!?.]+", raw)
title, body = (raw[:sep.end()], raw[sep.end():]) if sep else (raw, "") title, body = (raw[:sep.end()], raw[sep.end():]) if sep else (raw, "")