Skip to content

Commit

Permalink
fix: datetime.datetime is an instance of datetime.date
Browse files Browse the repository at this point in the history
  • Loading branch information
portswigger-tim committed Aug 9, 2023
1 parent 9c45b89 commit 998e5c2
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions ical-proxy/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,10 @@ def _ical_annotations(url: str, tags: str):
return ical_as_annotations


def _millis_timestamp(dt: datetime.datetime):
if isinstance(dt, datetime.date):
def _millis_timestamp(dt):
if (not isinstance(dt, datetime.datetime)) and isinstance(dt, datetime.date):
dt = datetime.datetime(dt.year, dt.month, dt.day, tzinfo=datetime.timezone.utc)

return int(dt.timestamp() * 1000)


Expand Down

0 comments on commit 998e5c2

Please sign in to comment.