`;
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();
});