mirror of
https://github.com/jrnl-org/jrnl.git
synced 2025-05-17 19:48:31 +02:00
Timezone parsing fix
This commit is contained in:
parent
4256052e90
commit
5b5c7cb6e8
1 changed files with 2 additions and 4 deletions
|
@ -124,10 +124,8 @@ def check_output(context, text=None):
|
||||||
def check_output_time_inline(context, text):
|
def check_output_time_inline(context, text):
|
||||||
out = context.stdout_capture.getvalue()
|
out = context.stdout_capture.getvalue()
|
||||||
local_tz = tzlocal.get_localzone()
|
local_tz = tzlocal.get_localzone()
|
||||||
utc_time = date_parser.parse(text)
|
local_time = date_parser.parse(text).astimezone(local_tz).strftime("%Y-%m-%d %H:%M")
|
||||||
date = utc_time + local_tz._utcoffset
|
assert local_time in out, local_time
|
||||||
local_date = date.strftime("%Y-%m-%d %H:%M")
|
|
||||||
assert local_date in out, local_date
|
|
||||||
|
|
||||||
@then('the output should contain "{text}"')
|
@then('the output should contain "{text}"')
|
||||||
def check_output_inline(context, text):
|
def check_output_inline(context, text):
|
||||||
|
|
Loading…
Add table
Reference in a new issue