Skip to content

Commit

Permalink
Merge pull request #277 from TelegramSam/feature/validate_additional
Browse files Browse the repository at this point in the history
Added additional date formats to validation.
  • Loading branch information
andrewwhitehead authored Nov 22, 2019
2 parents 46634cf + 2d1c70f commit f71dacf
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion aries_cloudagent/messaging/tests/test_valid.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,6 @@ def test_indy_date(self):
"2020-01-01",
"2020-01-01:00:00:00Z",
"2020.01.01 00:00:00Z",
"2020-01-01T00:00:00",
"2020-01-01T00:00.123456+00:00",
"2020-01-01T00:00:00.123456+0:00"
]
Expand All @@ -175,6 +174,8 @@ def test_indy_date(self):

INDY_ISO8601_DATETIME["validate"]("2020-01-01 00:00:00Z")
INDY_ISO8601_DATETIME["validate"]("2020-01-01T00:00:00Z")
INDY_ISO8601_DATETIME["validate"]("2020-01-01T00:00:00")
INDY_ISO8601_DATETIME["validate"]("2020-01-01 00:00:00")
INDY_ISO8601_DATETIME["validate"]("2020-01-01 00:00:00+00:00")
INDY_ISO8601_DATETIME["validate"]("2020-01-01 00:00:00-00:00")
INDY_ISO8601_DATETIME["validate"]("2020-01-01 00:00-00:00")
Expand Down
2 changes: 1 addition & 1 deletion aries_cloudagent/messaging/valid.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ def __init__(self):

super().__init__(
r"^\d{4}-\d\d-\d\d[T ]\d\d:\d\d"
r"(?:\:(?:\d\d(?:\.\d{1,6})?))?(?:[+-]\d\d:?\d\d|Z)$",
r"(?:\:(?:\d\d(?:\.\d{1,6})?))?(?:[+-]\d\d:?\d\d|Z|)$",
error="Value {input} is not a date in valid format."
)

Expand Down

0 comments on commit f71dacf

Please sign in to comment.