fix: show stats by logged in user

This commit is contained in:
cwilvx
2024-10-21 10:01:41 +03:00
parent a7666ad935
commit aea8c15f6f
4 changed files with 6 additions and 39 deletions
+2 -2
View File
@@ -15,7 +15,7 @@ def timestamp_from_days_ago(days_ago: int):
return int(past_timestamp.timestamp())
def create_new_date(date: datetime = None) -> str:
def create_new_date(date: datetime | None = None) -> str:
"""
Creates a new date and time string in the format of "YYYY-MM-DD HH:MM:SS"
:return: A string of the current date and time.
@@ -26,7 +26,7 @@ def create_new_date(date: datetime = None) -> str:
return date.strftime(_format)
def timestamp_to_time_passed(timestamp: str | int):
def timestamp_to_time_passed(timestamp: str | int | float):
"""
Converts a timestamp to time passed. e.g. 2 minutes ago, 1 hour ago, yesterday, 2 days ago, 2 weeks ago, etc.
"""