Skip to content

Commit

Permalink
Merge pull request #199 from eye-on-surveillance/AI/page-no-citations
Browse files Browse the repository at this point in the history
AI/page-no-citations
  • Loading branch information
ayyubibrahimi authored Jan 1, 2024
2 parents fb432ad + f67ce00 commit 6e6cd46
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/googlecloud/functions/getanswer/inquirer.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,13 @@

def convert_date_format(date_str):
"""Convert date from 'MM-DD-YYYY' to 'MM/DD/YYYY' format."""
if date_str is None or not isinstance(date_str, str):
return "date not available"

try:
return datetime.strptime(date_str, "%m-%d-%Y").strftime("%m/%d/%Y")
except ValueError:
return date_str # Return original string if format does not match
return "date not available"


def timestamp_to_seconds(timestamp):
Expand Down

0 comments on commit 6e6cd46

Please sign in to comment.