From b97f48858d7e1ac706e74d34a70b301af7a839cb Mon Sep 17 00:00:00 2001 From: mattbk Date: Wed, 6 Sep 2023 18:08:36 -0500 Subject: [PATCH] Quick fix of empty start time. --- vulpes/src/main.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/vulpes/src/main.cpp b/vulpes/src/main.cpp index 9d05535..4699ac2 100644 --- a/vulpes/src/main.cpp +++ b/vulpes/src/main.cpp @@ -78,8 +78,8 @@ const char index_html[] PROGMEM = R"rawliteral( console.log("Reloading"); } // Current start date to string - //s = %inputStartTimeUnix%; - s = "1694019170"; + s = %inputStartTimeUnix%; + //s = "1694019170"; console.log(s); current_start = new Date(s * 1000); //current_start_utc = current_start.toUTCString(); @@ -218,7 +218,11 @@ String processor(const String& var){ else if(var == "inputFloat"){ return readFile(SPIFFS, "/inputFloat.txt"); } else if(var == "inputStartTimeUnix"){ - return readFile(SPIFFS, "/inputStartTimeUnix.txt"); + String temp = readFile(SPIFFS, "/inputStartTimeUnix.txt"); + if(temp == ""){ + temp = "0"; + } + return temp; } return String(); }