[BUG] Event happening exactly now shows "In 0m" instead of "LIVE" #27

Closed
opened 2026-03-26 18:42:32 +01:00 by shoko · 0 comments
Owner

Bug Description

When an event is happening exactly at the current time (total_sec = 0), the time formatting shows "In 0m" instead of "LIVE".

Root Cause

In _get_time_data(), the condition if total_sec < 0 (past) catches events that have already started, but when total_sec == 0 (exactly now), it falls into the "future" branch:

if total_sec < 3600:  # True when total_sec = 0
    mins = int(total_sec / 60)  # = 0
    time_status = f"In {mins}m"  # Shows "In 0m"

Expected Behavior

Events happening exactly now should display as "LIVE", same as events that started less than 1 hour ago.

Proposed Fix

Treat total_sec == 0 as "LIVE" by adjusting the condition:

if total_sec <= 0:  # Include exactly now
    hours_ago = abs(total_sec) / 3600
    if hours_ago < 1:
        time_status = "LIVE"

Or add a special case:

if total_sec == 0:
    time_status = "LIVE"
    time_urgency = 3
elif total_sec < 0:
    # existing past event logic
## Bug Description When an event is happening exactly at the current time (`total_sec = 0`), the time formatting shows **"In 0m"** instead of **"LIVE"**. ## Root Cause In `_get_time_data()`, the condition `if total_sec < 0` (past) catches events that have already started, but when `total_sec == 0` (exactly now), it falls into the "future" branch: ```python if total_sec < 3600: # True when total_sec = 0 mins = int(total_sec / 60) # = 0 time_status = f"In {mins}m" # Shows "In 0m" ``` ## Expected Behavior Events happening exactly now should display as **"LIVE"**, same as events that started less than 1 hour ago. ## Proposed Fix Treat `total_sec == 0` as "LIVE" by adjusting the condition: ```python if total_sec <= 0: # Include exactly now hours_ago = abs(total_sec) / 3600 if hours_ago < 1: time_status = "LIVE" ``` Or add a special case: ```python if total_sec == 0: time_status = "LIVE" time_urgency = 3 elif total_sec < 0: # existing past event logic ```
shoko added the low label 2026-03-26 18:42:32 +01:00
shoko closed this issue 2026-03-26 18:53:14 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: shoko/jujutsu-skills#27