diff --git a/vulpes/src/main.cpp b/vulpes/src/main.cpp index 022e4c4..403a7f0 100644 --- a/vulpes/src/main.cpp +++ b/vulpes/src/main.cpp @@ -83,27 +83,26 @@ const char index_html[] PROGMEM = R"rawliteral( HH + ':' + II + ':' + SS; } - // Submit timestamps as unix seconds + // Submit timestamps as unix seconds when form is submitted var putDate = function(form) { form.inputTimeUnix.value = Math.floor(Date.now() / 1000);// - new Date().getTimezoneOffset()*60; form.inputStartTimeUnix.value = ((Date.parse(js_start_time_unix_entry.value))/1000); //document.getElementById("js_start_time_unix").value = ((Date.parse(js_start_time_unix_entry.value))/1000); } - // Refresh page after submit so values are right https://stackoverflow.com/a/1860732/2152245 + // Fill in page values window.onload = function() { - //document.getElementById("hidden-form").onload = function() { - //top.location.reload(); - //} - // Current start date to string s = %inputStartTimeUnix%; current_start = new Date(s * 1000); document.getElementById('current-start').innerHTML = current_start.toLocaleString(); // Show the local time as a string local_time_unix = new Date().toLocaleString();//toUTCString(); document.getElementById('local-time-unix').innerHTML = local_time_unix.toString(); - // fill in the start time field as local time - //document.getElementById('js_start_time_unix_entry').value = current_start.toISOString().slice(0,16); + // Fill in the start time field as local time document.getElementById('js_start_time_unix_entry').value = current_start.toDatetimeLocal(); + + // Fill in the other form fields + document.getElementById("send-program").value = %inputSend%; + document.getElementById("message").value = %inputMsg%; } @@ -114,7 +113,7 @@ const char index_html[] PROGMEM = R"rawliteral(

Sending program (cycle doesn't work yet) (current value: %inputSend%):