Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adds LocalTime control #278

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 4 additions & 2 deletions data/js/controls.js
Original file line number Diff line number Diff line change
Expand Up @@ -635,8 +635,10 @@ function start() {
break;

case UPDATE_TIME:
var rv = new Date().toISOString();
websock.send("time:" + rv + ":" + data.id);
var date = new Date();
websock.send("time:" + date.toISOString() + ":" + data.id);
date.setMinutes(date.getMinutes() - date.getTimezoneOffset());
websock.send("localtime:" + date.toISOString() + ":" + data.id);
break;

case UI_FRAGMENT:
Expand Down
254 changes: 127 additions & 127 deletions data/js/controls.min.js

Large diffs are not rendered by default.

20 changes: 10 additions & 10 deletions data/js/slider.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

68 changes: 34 additions & 34 deletions data/js/tabbedcontent.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions src/ESPUI.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ enum MessageTypes : uint8_t
#define T_VALUE 10
#define S_VALUE 11
#define TM_VALUE 12
#define TML_VALUE 13

enum Verbosity : uint8_t
{
Expand Down
5 changes: 5 additions & 0 deletions src/ESPUIcontrol.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,11 @@ void Control::onWsEvent(String & cmd, String& data)
// updateControl(c, client->id());
SendCallback(TM_VALUE);
}
else if (cmd.equals(F("localtime")))
{
value = data;
SendCallback(TML_VALUE);
}
else
{
#if defined(DEBUG_ESPUI)
Expand Down
1 change: 1 addition & 0 deletions src/ESPUIcontrol.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ enum ControlType : uint8_t
Accel,
Separator,
Time,
LocalTime,

Fragment,
Password = 99,
Expand Down