File tree Expand file tree Collapse file tree 1 file changed +7
-10
lines changed
stac_fastapi/core/stac_fastapi/core Expand file tree Collapse file tree 1 file changed +7
-10
lines changed Original file line number Diff line number Diff line change @@ -426,23 +426,20 @@ def _return_date(
426426
427427 return result
428428
429- def _format_datetime_range (self , date_tuple : DateTimeType ) -> str :
429+ def _format_datetime_range (self , date_tuple : str ) -> str :
430430 """
431- Convert a tuple of datetime objects or None into a formatted string for API requests .
431+ Convert a datetime range into a formatted string.
432432
433433 Args:
434- date_tuple (tuple ): A tuple containing two elements, each can be a datetime object or None .
434+ date_tuple (str ): A string containing two datetime values separated by a '/' .
435435
436436 Returns:
437437 str: A string formatted as 'YYYY-MM-DDTHH:MM:SS.sssZ/YYYY-MM-DDTHH:MM:SS.sssZ', with '..' used if any element is None.
438438 """
439-
440- def format_datetime (dt ):
441- """Format a single datetime object to the ISO8601 extended format with 'Z'."""
442- return dt .strftime ("%Y-%m-%dT%H:%M:%S.%f" )[:- 3 ] + "Z" if dt else ".."
443-
444- start , end = date_tuple
445- return f"{ format_datetime (start )} /{ format_datetime (end )} "
439+ start , end = date_tuple .split ("/" )
440+ start = start .replace ("+01:00" , "Z" ) if start else ".."
441+ end = end .replace ("+01:00" , "Z" ) if end else ".."
442+ return f"{ start } /{ end } "
446443
447444 async def get_search (
448445 self ,
You can’t perform that action at this time.
0 commit comments