Skip to content

Commit

Permalink
clarify datetime range is inclusive stac-utils#1382
Browse files Browse the repository at this point in the history
  • Loading branch information
tylanderson committed Oct 15, 2024
1 parent 5f0b8a1 commit 4a539a1
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
12 changes: 10 additions & 2 deletions pystac/common_metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,11 @@ def description(self, v: str | None) -> None:
# Date and Time Range
@property
def start_datetime(self) -> datetime | None:
"""Get or set the object's start_datetime."""
"""Get or set the object's start_datetime.
Note:
``start_datetime`` is an inclusive datetime.
"""
return utils.map_opt(
utils.str_to_datetime, self._get_field("start_datetime", str)
)
Expand All @@ -96,7 +100,11 @@ def start_datetime(self, v: datetime | None) -> None:

@property
def end_datetime(self) -> datetime | None:
"""Get or set the item's end_datetime."""
"""Get or set the item's end_datetime.
Note:
``end_datetime`` is an inclusive datetime.
"""
return utils.map_opt(
utils.str_to_datetime, self._get_field("end_datetime", str)
)
Expand Down
4 changes: 2 additions & 2 deletions pystac/item.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ class Item(STACObject, Assets):
datetime : datetime associated with this item. If None,
a start_datetime and end_datetime must be supplied.
properties : A dictionary of additional metadata for the item.
start_datetime : Optional start datetime, part of common metadata. This value
start_datetime : Optional inclusive start datetime, part of common metadata. This value
will override any `start_datetime` key in properties.
end_datetime : Optional end datetime, part of common metadata. This value
end_datetime : Optional inclusive end datetime, part of common metadata. This value
will override any `end_datetime` key in properties.
stac_extensions : Optional list of extensions the Item implements.
href : Optional HREF for this item, which be set as the item's
Expand Down

0 comments on commit 4a539a1

Please sign in to comment.