Clock from Phone

Hi Bruno,

I was working on a ui_template example along Colin's suggestions.
That is getting the time from the user browser sending to node-red and after that you have to process it with the exec node you mentioned

Example flow ...

[{"id":"ce3be529.f3d278","type":"ui_template","z":"f54b08eb.e98bb","group":"c205e26f.6865a","name":"","order":0,"width":"0","height":"0","format":"  <html>\n  <head>\n  <title>Time</title>\n  <script type=\"text/javascript\"> \n  \n  var date = new Date().toString();\n  document.getElementById('ct').innerHTML = date;\n  \n  this.scope.sendDate = function() {\n      console.log(\"in function\")\n   // return {payload: new Date().toString()}; // .valueOf() \n    return {payload: new Date().valueOf()}; // \n  }\n \n</script>\n  \n  </head>\n\n  <body>\n  <div id='ct' style=\"margin-bottom: 40px;\"></div>\n  <br>\n  <br>\n<md-button ng-click=\"send(sendDate())\">\n    Send time to Node-red\n</md-button>\n\n  </body>\n  </html>","storeOutMessages":true,"fwdInMessages":true,"resendOnRefresh":true,"templateScope":"local","x":720,"y":480,"wires":[["9352a614.0fc998"]]},{"id":"9352a614.0fc998","type":"debug","z":"f54b08eb.e98bb","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":900,"y":480,"wires":[]},{"id":"c205e26f.6865a","type":"ui_group","z":"","name":"Default","tab":"20af7edd.a91fca","order":1,"disp":true,"width":"12","collapse":false},{"id":"20af7edd.a91fca","type":"ui_tab","z":"","name":"Home","icon":"dashboard","disabled":false,"hidden":false}]
1 Like