Fixed day span

This commit is contained in:
2026-02-21 15:55:31 +01:00
parent 19d457bde6
commit 7b1f143cec
2 changed files with 15 additions and 12 deletions

View File

@@ -55,7 +55,7 @@ def get_upcoming_events(days_to_show=None, limit=None):
# PRIORITÄT 2: Tage-Logik
ende = heute + timedelta(days=int(days_to_show))
return [e for e in _cache["events"] if heute <= e[date_col] <= ende]
return [e for e in _cache["events"] if heute <= e[date_col] < ende]
def get_remarks():
if _is_cache_valid() and _cache["remarks"] is not None:

View File

@@ -16,16 +16,14 @@
}
.card { border: 1px solid #ddd; padding: 20px; margin-bottom: 20px; border-radius: 8px; }
/* Flex-Container für die Linksbündigkeit (Standard) */
.input-row {
margin-top: 15px;
display: flex;
justify-content: flex-start; /* Alles nach links */
justify-content: flex-start;
align-items: center;
gap: 25px; /* Abstand zwischen den Paaren (Tage / Zeilen) */
gap: 25px;
}
/* Gruppiert Label und Input eng zusammen */
.input-group {
display: flex;
align-items: center;
@@ -68,10 +66,10 @@
<div class="card">
<h3>Cache Management</h3>
<p>Der Cache wird automatisch alle 60 Minuten aktualisiert. Nach manuellen Änderungen in Google Sheets können Sie ihn hier sofort leeren.</p>
<a href="/cache-clear" class="btn">Cache jetzt löschen</a>
<a href="{{ url_for('clear_cache') }}" class="btn">Cache jetzt löschen</a>
</div>
<p><a href="/zeiten">← Zurück zur Ansicht</a></p>
<p><a href="{{ url_for('public_table') }}">← Zurück zur Ansicht</a></p>
<script>
const daysInput = document.getElementById('days_input');
@@ -81,19 +79,24 @@
function updateUrl() {
const days = parseInt(daysInput.value) || 0;
const lines = parseInt(linesInput.value) || 0;
const baseUrl = "{{ url_for('public_table') }}";
const baseUrl = "{{ url_for('public_table') }}"; // Holt den korrekten Pfad inkl. root_path
let url = "/zeiten?test=1";
// Wir bauen die Parameter-Kette sauber auf
let params = "?test=1";
if (lines > 0) {
url += `&lines=${lines}`;
// Zeilen-Limitierung hat Priorität
params += `&lines=${lines}`;
} else if (days > 0) {
url += `&days=${days}`;
// Tage-Filterung als Fallback
params += `&days=${days}`;
}
previewLink.href = `${baseUrl}?test=1${params}`;
// Den Link final zusammensetzen
previewLink.href = baseUrl + params;
}
// Event-Listener für Änderungen an den Eingabefeldern
daysInput.addEventListener('input', updateUrl);
linesInput.addEventListener('input', updateUrl);
</script>