mirror of
https://github.com/jrnl-org/jrnl.git
synced 2025-06-29 14:06:14 +02:00
Add UTC support for failing DayOne tests (#785)
* [Dayone] don't break if the system timezone is UTC * [DayOne] re-enable tests that were failing on Travis * [DayOne] change as per code review to avoid `except: pass`
This commit is contained in:
parent
8b7ebe2dcd
commit
66027e7746
2 changed files with 6 additions and 13 deletions
|
@ -52,7 +52,11 @@ class DayOne(Journal.Journal):
|
|||
except (KeyError, pytz.exceptions.UnknownTimeZoneError):
|
||||
timezone = tzlocal.get_localzone()
|
||||
date = dict_entry["Creation Date"]
|
||||
date = date + timezone.utcoffset(date, is_dst=False)
|
||||
# convert the date to UTC rather than keep messing with
|
||||
# timezones
|
||||
if timezone.zone != "UTC":
|
||||
date = date + timezone.utcoffset(date, is_dst=False)
|
||||
|
||||
entry = Entry.Entry(
|
||||
self,
|
||||
date,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue