Skip to content

Commit

Permalink
Returns empty string when no date in date converter (#493)
Browse files Browse the repository at this point in the history
  • Loading branch information
Te-k committed Apr 30, 2024
1 parent cbd41b2 commit 9d47acc
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions mvt/common/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ def convert_datetime_to_iso(date_time: datetime.datetime) -> str:
:rtype: str
"""
if not date_time:
return ""

if date_time.tzinfo:
# Timezone aware object - convert to UTC
date_time = date_time.astimezone(tz=datetime.timezone.utc)
Expand Down

0 comments on commit 9d47acc

Please sign in to comment.