Skip to content

Commit

Permalink
fix: datetime.datetime is the one with strptime method
Browse files Browse the repository at this point in the history
it's datetime.datetime not datetime
  • Loading branch information
engineervix committed Jun 18, 2023
1 parent b06218d commit f88063b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/core/utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ def format_filesize(filesize: int):

def is_valid_date(datestring: str) -> bool:
try:
if datestring != datetime.strptime(datestring, "%Y-%m-%d").strftime("%Y-%m-%d"):
if datestring != datetime.datetime.strptime(datestring, "%Y-%m-%d").strftime("%Y-%m-%d"):
raise ValueError("Incorrect date format, should be YYYY-MM-DD")
return True
except ValueError:
Expand Down

0 comments on commit f88063b

Please sign in to comment.