node-red-dashboard icon indicating copy to clipboard operation
node-red-dashboard copied to clipboard

node-red-dashboard Text Input / time picker Wrong time zone

Open kwithus opened this issue 4 years ago • 2 comments

I use a global.variable with a time in Format hh:mm which I want to populate with the text input / time-picker. I prepopulate the time picker by changing the variable with time-compare-and-change-Node to milliseconds-Unix-time and afterwards change it back to hh:mm. So far that works good, however the dashboard shows me always GMT time. So when I prepopulate with 15:00 I do get 13:00 on the dashboard. When I change the dashboard to 16:00 I do get 18:00 (MIddleEuropeansummerTime) as Output Well, I could just ad an offset, however as long as we do have Summer/Winter time that would mean I manually change the flow twice a year.

[{"id":"f5cd872a.32c3c","type":"change","z":"105dcd24.eee87b","name":"","rules":[{"t":"set","p":"Testzeit2","pt":"global","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1020,"y":460,"wires":[[]]},{"id":"2f4f71a6.530206","type":"change","z":"105dcd24.eee87b","name":"","rules":[{"t":"set","p":"Testzeit1","pt":"global","to":"18:00","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":640,"y":700,"wires":[[]]},{"id":"fe95e163.88ac98","type":"inject","z":"105dcd24.eee87b","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"Testzeit1","payloadType":"global","x":120,"y":440,"wires":[["4bd829a8.646ce","9fc24a14.417cf8"]]},{"id":"4bd829a8.646ce","type":"time-comp","z":"105dcd24.eee87b","outputs":1,"name":"","positionConfig":"51ad7f22.29ebc8","input":"payload","inputType":"msg","inputFormat":"HH:mm","inputOffset":"","inputOffsetType":"none","inputOffsetMultiplier":"3600000","rules":[],"checkall":"true","result1":"","result1Type":"msgPayload","result1Value":"","result1ValueType":"input","result1Format":"0","result1Offset":0,"result1OffsetType":"none","result1OffsetMultiplier":60000,"x":320,"y":360,"wires":[["8edf9527.af19e8","f808ef2.062971"]]},{"id":"9fc24a14.417cf8","type":"debug","z":"105dcd24.eee87b","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":330,"y":560,"wires":[]},{"id":"8edf9527.af19e8","type":"debug","z":"105dcd24.eee87b","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":470,"y":220,"wires":[]},{"id":"e906fc88.5083b8","type":"debug","z":"105dcd24.eee87b","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":770,"y":220,"wires":[]},{"id":"c22e78ef.bf719","type":"debug","z":"105dcd24.eee87b","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":970,"y":300,"wires":[]},{"id":"961a4e61.05ce48","type":"inject","z":"105dcd24.eee87b","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":330,"y":700,"wires":[["2f4f71a6.530206"]]},{"id":"f808ef2.062971","type":"ui_text_input","z":"105dcd24.eee87b","name":"","label":"","tooltip":"","group":"65a72644.483318","order":4,"width":0,"height":0,"passthru":true,"mode":"time","delay":300,"topic":"","x":500,"y":360,"wires":[["54c0f152.8d75c","e906fc88.5083b8"]]},{"id":"54c0f152.8d75c","type":"time-comp","z":"105dcd24.eee87b","outputs":1,"name":"","positionConfig":"51ad7f22.29ebc8","input":"payload","inputType":"msg","inputFormat":"0","inputOffset":"","inputOffsetType":"none","inputOffsetMultiplier":"3600000","rules":[],"checkall":"true","result1":"","result1Type":"msgPayload","result1Value":"","result1ValueType":"input","result1Format":"HH:mm","result1Offset":0,"result1OffsetType":"none","result1OffsetMultiplier":60000,"x":700,"y":360,"wires":[["c22e78ef.bf719","f5cd872a.32c3c"]]},{"id":"51ad7f22.29ebc8","type":"position-config","z":"","name":"Garbsen","isValide":"true","longitude":"0","latitude":"0","angleType":"deg","timeZoneOffset":99,"timeZoneDST":0,"stateTimeFormat":"3","stateDateFormat":"12"},{"id":"65a72644.483318","type":"ui_group","z":"","name":"Virtuelle Taste BidCoS-RF:1","tab":"fe205248.f04ed","order":1,"disp":true,"width":"6","collapse":false},{"id":"fe205248.f04ed","type":"ui_tab","z":"","name":"Geräte","icon":"dashboard","order":1}]

Please tell us about your environment:

  • [ ] Node-RED-Dashboard version:2.23.4
  • [ ] Node-RED version:1.1.3
  • [ ] node.js version:
  • [ ] npm version:
  • [ ] Platform/OS:redmatic on ccu3
  • [ ] Browser:iOS 14 Safari

kwithus avatar Oct 19 '20 18:10 kwithus

This is still a bug in NR v2.2.2 and dashboard v3.1.6

Using an inject node sending a timestamp thru the ui-text-input to a debug node shows the correct time, but the dashboard is off by the UTC difference of the local time zone. Screen Shot 2022-03-22 at 8 25 48 PM

Entering a time in the dashboard ends up showing the time - in the debug output - offset by the local UTC difference Screen Shot 2022-03-22 at 8 27 24 PM

flow showing issue: [{"id":"eaa6d97a6ede80ab","type":"tab","label":"Flow 1","disabled":false,"info":"","env":[]},{"id":"67364e248a49184b","type":"inject","z":"eaa6d97a6ede80ab","name":"insert time","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":220,"y":200,"wires":[["c9cdb8a6a4f30103","c84d0204954ca237"]]},{"id":"c9cdb8a6a4f30103","type":"ui_text_input","z":"eaa6d97a6ede80ab","name":"","label":"","tooltip":"","group":"34c8e5f1.3881fa","order":16,"width":0,"height":0,"passthru":true,"mode":"time","delay":"0","topic":"topic","sendOnBlur":true,"className":"","topicType":"msg","x":420,"y":200,"wires":[["a7873f0dec9b91d1"]]},{"id":"c84d0204954ca237","type":"debug","z":"eaa6d97a6ede80ab","name":"from inject","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":610,"y":100,"wires":[]},{"id":"a7873f0dec9b91d1","type":"debug","z":"eaa6d97a6ede80ab","name":"from ui-text-input","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":630,"y":200,"wires":[]},{"id":"34c8e5f1.3881fa","type":"ui_group","name":"test","tab":"43b06d842d4a7b64","order":1,"disp":true,"width":"15","collapse":false,"className":""},{"id":"43b06d842d4a7b64","type":"ui_tab","name":"Test","icon":"dashboard","disabled":false,"hidden":false}]

juggledad avatar Mar 23 '22 00:03 juggledad

I think this is a "feature" of html text input in time mode - eg see https://stackoverflow.com/questions/59166282/input-type-time-showing-wrong-timezone I don't think there is an easy fix for this

dceejay avatar Mar 23 '22 23:03 dceejay