Fix ] key navigation on Verse of the Day

- next_date is now None when viewing today (can't go to future)
- ] only navigates when viewing a past date
- Simplified template logic

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-12-06 14:24:30 -05:00
parent ac4c79731f
commit dad8e2d1ce
2 changed files with 3 additions and 5 deletions
+2 -1
View File
@@ -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 = []
+1 -4
View File
@@ -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