From d33ad725cb658c42baf0faecb5cff081729667a7 Mon Sep 17 00:00:00 2001 From: James Pattinson Date: Thu, 4 Dec 2025 17:21:55 +0000 Subject: [PATCH] Pre-prod tweaks --- web/admin.html | 12 ++++++------ web/ppr.html | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+), 6 deletions(-) diff --git a/web/admin.html b/web/admin.html index a4ea95a..663915b 100644 --- a/web/admin.html +++ b/web/admin.html @@ -583,7 +583,7 @@
- 🛬 Today's Arrivals - 0 entries (NEW & CONFIRMED) + 🛬 Today's Arrivals - 0 entries
@@ -618,7 +618,7 @@
- 🛫 Today's Departures - 0 entries (LANDED) + 🛫 Today's Departures - 0 entries
@@ -1327,10 +1327,10 @@ ${ppr.fuel || '-'} `; @@ -1376,10 +1376,10 @@ ${ppr.landed_dt ? formatTimeOnly(ppr.landed_dt) : '-'} `; diff --git a/web/ppr.html b/web/ppr.html index 3f88b21..1dd8d63 100644 --- a/web/ppr.html +++ b/web/ppr.html @@ -685,9 +685,44 @@ } }); + // Set default date and time values + function setDefaultDateTime() { + const now = new Date(); + // Round up to the next hour + const nextHour = new Date(now); + nextHour.setHours(now.getHours() + 1, 0, 0, 0); + + // ETD is 1 hour after ETA + const etd = new Date(nextHour); + etd.setHours(nextHour.getHours() + 1); + + // Format date and time for separate inputs + function formatDate(date) { + const year = date.getFullYear(); + const month = String(date.getMonth() + 1).padStart(2, '0'); + const day = String(date.getDate()).padStart(2, '0'); + return `${year}-${month}-${day}`; + } + + function formatTime(date) { + const hours = String(date.getHours()).padStart(2, '0'); + const minutes = String(date.getMinutes()).padStart(2, '0'); + return `${hours}:${minutes}`; + } + + // Set ETA to next hour + document.getElementById('eta-date').value = formatDate(nextHour); + document.getElementById('eta-time').value = formatTime(nextHour); + + // Set ETD to one hour after ETA + document.getElementById('etd-date').value = formatDate(etd); + document.getElementById('etd-time').value = formatTime(etd); + } + // Initialize the page when DOM is loaded document.addEventListener('DOMContentLoaded', function() { initializeTimeDropdowns(); + setDefaultDateTime(); });