Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pendulum/formatting/formatter.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
_MATCH_5_TO_6 = "\d{5}\d?"
_MATCH_UNSIGNED = "\d+"
_MATCH_SIGNED = "[+-]?\d+"
_MATCH_OFFSET = "(?i)Z|[+-]\d\d:?\d\d"
_MATCH_SHORT_OFFSET = "(?i)Z|[+-]\d\d(?::?\d\d)?"
_MATCH_OFFSET = "[Zz]|[+-]\d\d:?\d\d"
_MATCH_SHORT_OFFSET = "[Zz]|[+-]\d\d(?::?\d\d)?"
_MATCH_TIMESTAMP = "[+-]?\d+(\.\d{1,6})?"
_MATCH_WORD = (
"(?i)[0-9]*"
Expand Down
4 changes: 2 additions & 2 deletions tests/formatting/test_formatter.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,8 +238,8 @@ def test_date_formats():
def test_escape():
f = Formatter()
d = pendulum.datetime(2016, 8, 28)
assert f.format(d, "[YYYY] YYYY \[YYYY\]") == "YYYY 2016 [2016]"
assert f.format(d, "\D D \\\D") == "D 28 \\28"
assert f.format(d, r"[YYYY] YYYY \[YYYY\]") == "YYYY 2016 [2016]"
assert f.format(d, r"\D D \\D") == "D 28 \\28"


def test_date_formats_missing():
Expand Down