fixed timezone for time sync from browser #336 (thx @DanielR92)

This commit is contained in:
lumapu 2022-10-12 12:38:23 +02:00
parent 6bf6e357ca
commit dbdc2ad5ab
4 changed files with 8 additions and 9 deletions

View file

@ -392,12 +392,10 @@ bool webApi::setCtrl(DynamicJsonDocument jsonIn, JsonObject jsonOut) {
//-----------------------------------------------------------------------------
bool webApi::setSetup(DynamicJsonDocument jsonIn, JsonObject jsonOut) {
if(F("set_time") == jsonIn[F("cmd")]) {
if(F("set_time") == jsonIn[F("cmd")])
mApp->setTimestamp(jsonIn[F("ts")]);
}
else if(F("sync_ntp") == jsonIn[F("cmd")]) {
else if(F("sync_ntp") == jsonIn[F("cmd")])
mApp->setTimestamp(0); // 0: update ntp flag
}
else {
jsonOut[F("error")] = F("unknown cmd");
return false;