Quick fix of empty start time.

This commit is contained in:
mattbk 2023-09-06 18:08:36 -05:00
parent b648900c7b
commit b97f48858d

View File

@ -78,8 +78,8 @@ const char index_html[] PROGMEM = R"rawliteral(
console.log("Reloading"); console.log("Reloading");
} }
// Current start date to string // Current start date to string
//s = %inputStartTimeUnix%; s = %inputStartTimeUnix%;
s = "1694019170"; //s = "1694019170";
console.log(s); console.log(s);
current_start = new Date(s * 1000); current_start = new Date(s * 1000);
//current_start_utc = current_start.toUTCString(); //current_start_utc = current_start.toUTCString();
@ -218,7 +218,11 @@ String processor(const String& var){
else if(var == "inputFloat"){ else if(var == "inputFloat"){
return readFile(SPIFFS, "/inputFloat.txt"); return readFile(SPIFFS, "/inputFloat.txt");
} else if(var == "inputStartTimeUnix"){ } else if(var == "inputStartTimeUnix"){
return readFile(SPIFFS, "/inputStartTimeUnix.txt"); String temp = readFile(SPIFFS, "/inputStartTimeUnix.txt");
if(temp == ""){
temp = "0";
}
return temp;
} }
return String(); return String();
} }