diff --git a/kjvstudy_org/routes/misc.py b/kjvstudy_org/routes/misc.py index f8781f6..d645500 100644 --- a/kjvstudy_org/routes/misc.py +++ b/kjvstudy_org/routes/misc.py @@ -240,8 +240,9 @@ async def verse_of_the_day_page( # Calculate prev/next dates for navigation prev_date = (current_date - timedelta(days=1)).strftime("%Y-%m-%d") - next_date = (current_date + timedelta(days=1)).strftime("%Y-%m-%d") today_str = datetime.now().strftime("%Y-%m-%d") + # Only allow next_date if viewing a past date (can't go to future) + next_date = (current_date + timedelta(days=1)).strftime("%Y-%m-%d") if date_str < today_str else None # Generate past 30 days of verses (from the viewed date) past_verses = [] diff --git a/kjvstudy_org/templates/verse_of_the_day.html b/kjvstudy_org/templates/verse_of_the_day.html index 7ccf5fc..df66199 100644 --- a/kjvstudy_org/templates/verse_of_the_day.html +++ b/kjvstudy_org/templates/verse_of_the_day.html @@ -465,11 +465,8 @@ } else if (e.key === ']') { // Next day (only if not viewing future) e.preventDefault(); - {% if not is_today %} + {% if next_date %} window.location.href = '/verse-of-the-day?date={{ next_date }}'; - {% else %} - // Already on today, go to today's page (removes query param) - window.location.href = '/verse-of-the-day'; {% endif %} } else if (e.key === 't') { // Jump to today