I have a ui_table
in a dashboard with dates populated. The requirement is to select two dates from the table by clicking it one after another from same table. But with each progressive click the function should calculate minimum of the dates (last click and present click) set mindate
to the lowest date and maxdate
to the highest date. so for next click again it should calculate the min and max and set the payload accordingly.
i have put in a sample flow with inject nodes populating the ui_table for anyone to try this out.
[{"id":"8aa48dca4503e76d","type":"inject","z":"62edb5cfe5bc1272","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"[{\"Date\":\"2023-04-26\"},{\"Date\":\"2023-04-25\"},{\"Date\":\"2023-04-24\"},{\"Date\":\"2023-04-23\"},{\"Date\":\"2023-04-22\"},{\"Date\":\"2023-04-21\"},{\"Date\":\"2023-04-20\"},{\"Date\":\"2023-04-19\"},{\"Date\":\"2023-04-18\"},{\"Date\":\"2023-04-17\"},{\"Date\":\"2023-04-16\"},{\"Date\":\"2023-04-15\"},{\"Date\":\"2023-04-14\"},{\"Date\":\"2023-04-13\"},{\"Date\":\"2023-04-12\"},{\"Date\":\"2023-04-11\"},{\"Date\":\"2023-04-10\"},{\"Date\":\"2023-04-09\"},{\"Date\":\"2023-04-08\"},{\"Date\":\"2023-04-07\"}]","payloadType":"json","x":320,"y":1600,"wires":[["8cfcd8a7cc53bd4b"]]},{"id":"8cfcd8a7cc53bd4b","type":"ui_table","z":"62edb5cfe5bc1272","group":"bc03f2e4910af504","name":"Date","order":10,"width":"8","height":"11","columns":[],"outputs":1,"cts":true,"x":470,"y":1600,"wires":[["c0e7fc4eadd5b8fb"]]},{"id":"c0e7fc4eadd5b8fb","type":"debug","z":"62edb5cfe5bc1272","name":"debug 286","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":650,"y":1600,"wires":[]},{"id":"bc03f2e4910af504","type":"ui_group","name":"BD_STATUS","tab":"da4cef9c6caa6145","order":1,"disp":false,"width":"42","collapse":false,"className":""},{"id":"da4cef9c6caa6145","type":"ui_tab","name":"HOME","icon":"dashboard","order":2,"disabled":false,"hidden":false}]