From cd7e918690b14b0325d5b5d04f90379f5d7e495d Mon Sep 17 00:00:00 2001 From: Paul Date: Sun, 3 Nov 2019 11:05:49 +0100 Subject: [PATCH] timezone improvements --- src/MyESP.cpp | 2 +- src/Ntp.cpp | 6 ++++++ src/websrc/index.html | 2 +- src/websrc/myesp.htm | 22 ++++++++++------------ src/websrc/myesp.js | 2 -- tools/wsemulator/wserver.js | 2 +- 6 files changed, 19 insertions(+), 17 deletions(-) diff --git a/src/MyESP.cpp b/src/MyESP.cpp index 1d5392360..81897c5a7 100644 --- a/src/MyESP.cpp +++ b/src/MyESP.cpp @@ -2467,7 +2467,7 @@ void MyESP::_onWsEvent(AsyncWebSocket * server, AsyncWebSocketClient * client, A // handle ws from browser void MyESP::_procMsg(AsyncWebSocketClient * client, size_t sz) { // We should always get a JSON object from browser, so parse it - StaticJsonDocument<400> doc; + StaticJsonDocument<500> doc; char json[sz + 1]; memcpy(json, (char *)(client->_tempObject), sz); json[sz] = '\0'; diff --git a/src/Ntp.cpp b/src/Ntp.cpp index 5b294ee40..156184972 100644 --- a/src/Ntp.cpp +++ b/src/Ntp.cpp @@ -13,6 +13,12 @@ IPAddress NtpClient::timeServer; AsyncUDP NtpClient::udpListener; byte NtpClient::NTPpacket[NTP_PACKET_SIZE]; +// references: +// https://github.com/filipdanic/compact-timezone-list/blob/master/index.js +// https://github.com/sanohin/google-timezones-json/blob/master/timezones.json +// https://github.com/dmfilipenko/timezones.json/blob/master/timezones.json +// https://home.kpn.nl/vanadovv/time/TZworld.html + // Australia Eastern Time Zone (Sydney, Melbourne) TimeChangeRule aEDT = {"AEDT", First, Sun, Oct, 2, 660}; // UTC + 11 hours TimeChangeRule aEST = {"AEST", First, Sun, Apr, 3, 600}; // UTC + 10 hours diff --git a/src/websrc/index.html b/src/websrc/index.html index 074fec01c..0bd7ac770 100644 --- a/src/websrc/index.html +++ b/src/websrc/index.html @@ -212,7 +212,7 @@
-
+
diff --git a/src/websrc/myesp.htm b/src/websrc/myesp.htm index 81ffcd160..963e79ce6 100644 --- a/src/websrc/myesp.htm +++ b/src/websrc/myesp.htm @@ -338,22 +338,21 @@

Time Settings -
With Network Time Protocol (NTP) enabled, all times are adjusted to the local timezone - and - respect daylight saving - time (DST)
+
With Network Time Protocol (NTP) enabled, all times are adjusted to the local timezone and + respect daylight saving time (DST)

- - + +
+ +
+
- - -
-
+
+