polymarket-browse: fix relative time - show LIVE instead of In 0m when event is starting now
This commit is contained in:
@@ -256,7 +256,9 @@ def get_match_time_status(e):
|
|||||||
else:
|
else:
|
||||||
# Starts in future
|
# Starts in future
|
||||||
hours_until = delta.total_seconds() / 3600
|
hours_until = delta.total_seconds() / 3600
|
||||||
if hours_until < 1:
|
if hours_until <= 0:
|
||||||
|
return "LIVE", 3
|
||||||
|
elif hours_until < 1:
|
||||||
mins = int(delta.total_seconds() / 60)
|
mins = int(delta.total_seconds() / 60)
|
||||||
return f"In {mins}m", 3
|
return f"In {mins}m", 3
|
||||||
elif hours_until < 24:
|
elif hours_until < 24:
|
||||||
@@ -293,7 +295,9 @@ def get_match_time_str(e):
|
|||||||
return f"{days}d ago"
|
return f"{days}d ago"
|
||||||
else:
|
else:
|
||||||
hours_until = delta.total_seconds() / 3600
|
hours_until = delta.total_seconds() / 3600
|
||||||
if hours_until < 1:
|
if hours_until <= 0:
|
||||||
|
return "LIVE"
|
||||||
|
elif hours_until < 1:
|
||||||
mins = int(delta.total_seconds() / 60)
|
mins = int(delta.total_seconds() / 60)
|
||||||
return f"In {mins}m"
|
return f"In {mins}m"
|
||||||
elif hours_until < 24:
|
elif hours_until < 24:
|
||||||
@@ -437,7 +441,9 @@ def get_start_time_wib(e):
|
|||||||
rel_str = f"{days}d ago"
|
rel_str = f"{days}d ago"
|
||||||
else:
|
else:
|
||||||
hours_until = delta.total_seconds() / 3600
|
hours_until = delta.total_seconds() / 3600
|
||||||
if hours_until < 1:
|
if hours_until <= 0:
|
||||||
|
rel_str = "LIVE"
|
||||||
|
elif hours_until < 1:
|
||||||
mins_until = int(delta.total_seconds() / 60)
|
mins_until = int(delta.total_seconds() / 60)
|
||||||
rel_str = f"In {mins_until}m"
|
rel_str = f"In {mins_until}m"
|
||||||
elif hours_until < 24:
|
elif hours_until < 24:
|
||||||
|
|||||||
Reference in New Issue
Block a user