mirror of https://github.com/zulip/zulip.git
bugdown: Import datetime our normal way.
This commit is contained in:
parent
6ea3816fa6
commit
3ec068f10c
|
@ -1,5 +1,6 @@
|
||||||
# Zulip's main markdown implementation. See docs/subsystems/markdown.md for
|
# Zulip's main markdown implementation. See docs/subsystems/markdown.md for
|
||||||
# detailed documentation on our markdown syntax.
|
# detailed documentation on our markdown syntax.
|
||||||
|
import datetime
|
||||||
import functools
|
import functools
|
||||||
import html
|
import html
|
||||||
import logging
|
import logging
|
||||||
|
@ -10,7 +11,6 @@ import urllib
|
||||||
import urllib.parse
|
import urllib.parse
|
||||||
from collections import defaultdict, deque
|
from collections import defaultdict, deque
|
||||||
from dataclasses import dataclass
|
from dataclasses import dataclass
|
||||||
from datetime import datetime
|
|
||||||
from io import StringIO
|
from io import StringIO
|
||||||
from typing import (
|
from typing import (
|
||||||
Any,
|
Any,
|
||||||
|
@ -1236,7 +1236,7 @@ class Timestamp(markdown.inlinepatterns.Pattern):
|
||||||
timestamp = dateutil.parser.parse(time_input_string, tzinfos=get_common_timezones())
|
timestamp = dateutil.parser.parse(time_input_string, tzinfos=get_common_timezones())
|
||||||
except ValueError:
|
except ValueError:
|
||||||
try:
|
try:
|
||||||
timestamp = datetime.fromtimestamp(float(time_input_string))
|
timestamp = datetime.datetime.fromtimestamp(float(time_input_string))
|
||||||
except ValueError:
|
except ValueError:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue