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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
### Fixed

- Some mishandled cases for datetime intervals [#363](https://github.com/stac-utils/pystac-client/pull/363)
- Parse datetimes more strictly [#364](https://github.com/stac-utils/pystac-client/pull/364)

### Removed

Expand Down
4 changes: 2 additions & 2 deletions pystac_client/item_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@
from pystac_client import client as _client

DATETIME_REGEX = re.compile(
r"(?P<year>\d{4})(-(?P<month>\d{2})(-(?P<day>\d{2})"
r"^(?P<year>\d{4})(-(?P<month>\d{2})(-(?P<day>\d{2})"
r"(?P<remainder>([Tt])\d{2}:\d{2}:\d{2}(\.\d+)?"
r"(?P<tz_info>Z|([-+])(\d{2}):(\d{2}))?)?)?)?"
r"(?P<tz_info>[Zz]|([-+])(\d{2}):(\d{2}))?)?)?)?$"
)


Expand Down
4 changes: 4 additions & 0 deletions tests/test_item_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,10 @@ def test_datetime_list_of_one_none(self) -> None:
with pytest.raises(Exception):
ItemSearch(url=SEARCH_URL, datetime=[None])

def test_poorly_formed_datetimes(self) -> None:
with pytest.raises(Exception):
ItemSearch(url=SEARCH_URL, datetime="2020-7/2020-8")

def test_single_collection_string(self) -> None:
# Single ID string
search = ItemSearch(url=SEARCH_URL, collections="naip")
Expand Down