Thank you very much. That makes it a lot easier for me.
Here is the finished flow:
[{"id":"b56ba51808f6b65d","type":"function","z":"f1c196de.aec348","name":"1","func":"msg.payload = msg.payload.gelber[1];\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":690,"y":840,"wires":[["3e52cc1197f007e5"]]},{"id":"3e52cc1197f007e5","type":"function","z":"f1c196de.aec348","name":"DATUM","func":"msg.payload = msg.payload.DATUM;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":880,"y":840,"wires":[["046ac92ca0f03489"]]},{"id":"6326fda3b8f0c38d","type":"function","z":"f1c196de.aec348","name":"2","func":"msg.payload = msg.payload.gelber[2];\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":690,"y":880,"wires":[["1d3933efc462e7bb"]]},{"id":"1d3933efc462e7bb","type":"function","z":"f1c196de.aec348","name":"DATUM","func":"msg.payload = msg.payload.DATUM;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":880,"y":880,"wires":[["fd102484e884f383"]]},{"id":"c0a0cde01420656f","type":"function","z":"f1c196de.aec348","name":"0","func":"msg.payload = msg.payload.gelber[0];\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":690,"y":800,"wires":[["70aa301ce8b40c82","296a017e4f47aea2"]]},{"id":"70aa301ce8b40c82","type":"function","z":"f1c196de.aec348","name":"DATUM","func":"msg.payload = msg.payload.DATUM;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":880,"y":800,"wires":[["b1d4b405fecfe897"]]},{"id":"50740c9dfc289883","type":"function","z":"f1c196de.aec348","name":"DATUM","func":"msg.payload = msg.payload.DATUM;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":880,"y":1020,"wires":[["50beebadaca20e79"]]},{"id":"f69d52c9dfe4d04f","type":"function","z":"f1c196de.aec348","name":"DATUM","func":"msg.payload = msg.payload.DATUM;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":880,"y":1060,"wires":[["554643eec03d3cfb"]]},{"id":"804ec6e12ac393ca","type":"function","z":"f1c196de.aec348","name":"DATUM","func":"msg.payload = msg.payload.DATUM;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":880,"y":980,"wires":[["3fb3ab8f9bc45276"]]},{"id":"3ad4367a14f946b0","type":"function","z":"f1c196de.aec348","name":"DATUM","func":"msg.payload = msg.payload.DATUM;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":880,"y":1200,"wires":[["4938f333a7a2816e"]]},{"id":"192a641e27acf753","type":"function","z":"f1c196de.aec348","name":"DATUM","func":"msg.payload = msg.payload.DATUM;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":880,"y":1240,"wires":[["b28579ba0c43e9ba"]]},{"id":"1a2ef3064b6ce0d0","type":"function","z":"f1c196de.aec348","name":"DATUM","func":"msg.payload = msg.payload.DATUM;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":880,"y":1160,"wires":[["b981eaec726815f9"]]},{"id":"c30e42de091ae05a","type":"function","z":"f1c196de.aec348","name":"DATUM","func":"msg.payload = msg.payload.DATUM;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":880,"y":1380,"wires":[["e0f2ad8fb86e268a"]]},{"id":"2f05b904526d2612","type":"function","z":"f1c196de.aec348","name":"DATUM","func":"msg.payload = msg.payload.DATUM;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":880,"y":1420,"wires":[["31e3823a7b1b97c1"]]},{"id":"3069d8f819c0d4b8","type":"function","z":"f1c196de.aec348","name":"DATUM","func":"msg.payload = msg.payload.DATUM;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":880,"y":1340,"wires":[["6513288a6084ab44"]]},{"id":"cc2e1f586dc9070f","type":"function","z":"f1c196de.aec348","name":"filter","func":"\n// keep only the date - remove day word\nmsg.payload = msg.payload.map(el => {\n return { ...el, DATUM: el.DATUM.split(\" \")[0] }\n});\n\n// gelber\nlet gelber = msg.payload.filter(el => {\n return (el.TERMIN === \"Gelber Sack Alle\")\n}).map(el => {\n return { ...el, \"diffDays\": moment(el.DATUM, \"DD.MM.YYYY\").diff(moment(), \"days\") }\n});\n\n// biotonne\nlet biotonne = msg.payload.filter(el => {\n return (el.TERMIN === \"Biotonne Alle\")\n}).map(el => {\n return { ...el, \"diffDays\": moment(el.DATUM, \"DD.MM.YYYY\").diff(moment(), \"days\") }\n});\n\n// hausabfall\nlet hausabfall = msg.payload.filter(el => {\n return (el.TERMIN === \"Hausabfall wöchentlich\")\n}).map(el => {\n return { ...el, \"diffDays\": moment(el.DATUM, \"DD.MM.YYYY\").diff(moment(), \"days\") }\n});\n\n// papiertonne\nlet papiertonne = msg.payload.filter(el => {\n return (el.TERMIN === \"Papiertonne Alle\")\n}).map(el => {\n return { ...el, \"diffDays\": moment(el.DATUM, \"DD.MM.YYYY\").diff(moment(), \"days\") }\n});;\n\n\nlet newMsg = { payload: { gelber, biotonne, hausabfall, papiertonne } }\n\nreturn newMsg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[{"var":"moment","module":"moment"}],"x":510,"y":840,"wires":[["c0a0cde01420656f","b56ba51808f6b65d","6326fda3b8f0c38d","779a46d5a2fcdd30","c3c85378f0ed9859","cf2ba86ac9283e32","4661ee117dfce15b","8d274eaef7960e0a","ee524628c22280de","a775b9d5b7381eb7","9b7e5d6c1b1be908","c24b06476a636048"]]},{"id":"779a46d5a2fcdd30","type":"function","z":"f1c196de.aec348","name":"0","func":"msg.payload = msg.payload.biotonne[0];\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":690,"y":980,"wires":[["804ec6e12ac393ca","e0aa04c4bd95d0c1"]]},{"id":"c3c85378f0ed9859","type":"function","z":"f1c196de.aec348","name":"1","func":"msg.payload = msg.payload.biotonne[1];\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":690,"y":1020,"wires":[["50740c9dfc289883"]]},{"id":"cf2ba86ac9283e32","type":"function","z":"f1c196de.aec348","name":"2","func":"msg.payload = msg.payload.biotonne[2];\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":690,"y":1060,"wires":[["f69d52c9dfe4d04f"]]},{"id":"4661ee117dfce15b","type":"function","z":"f1c196de.aec348","name":"0","func":"msg.payload = msg.payload.hausabfall[0];\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":690,"y":1160,"wires":[["1a2ef3064b6ce0d0","5552188f551028c2"]]},{"id":"8d274eaef7960e0a","type":"function","z":"f1c196de.aec348","name":"1","func":"msg.payload = msg.payload.hausabfall[1];\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":690,"y":1200,"wires":[["3ad4367a14f946b0"]]},{"id":"ee524628c22280de","type":"function","z":"f1c196de.aec348","name":"2","func":"msg.payload = msg.payload.hausabfall[2];\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":690,"y":1240,"wires":[["192a641e27acf753"]]},{"id":"a775b9d5b7381eb7","type":"function","z":"f1c196de.aec348","name":"0","func":"msg.payload = msg.payload.papiertonne[0];\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":690,"y":1340,"wires":[["3069d8f819c0d4b8","9c4dc7bc6839d11d"]]},{"id":"9b7e5d6c1b1be908","type":"function","z":"f1c196de.aec348","name":"1","func":"msg.payload = msg.payload.papiertonne[1];\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":690,"y":1380,"wires":[["c30e42de091ae05a"]]},{"id":"c24b06476a636048","type":"function","z":"f1c196de.aec348","name":"2","func":"msg.payload = msg.payload.papiertonne[2];\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":690,"y":1420,"wires":[["2f05b904526d2612"]]},{"id":"b1d4b405fecfe897","type":"ui_text_input","z":"f1c196de.aec348","name":"","label":"","tooltip":"","group":"06599b9d50fb496a","order":0,"width":0,"height":0,"passthru":true,"mode":"text","delay":300,"topic":"topic","topicType":"msg","x":1060,"y":800,"wires":[[]]},{"id":"046ac92ca0f03489","type":"ui_text_input","z":"f1c196de.aec348","name":"","label":"","tooltip":"","group":"06599b9d50fb496a","order":0,"width":0,"height":0,"passthru":true,"mode":"text","delay":300,"topic":"topic","topicType":"msg","x":1060,"y":840,"wires":[[]]},{"id":"3fb3ab8f9bc45276","type":"ui_text_input","z":"f1c196de.aec348","name":"","label":"","tooltip":"","group":"6791309b002b5e23","order":0,"width":0,"height":0,"passthru":true,"mode":"text","delay":300,"topic":"topic","topicType":"msg","x":1060,"y":980,"wires":[[]]},{"id":"b981eaec726815f9","type":"ui_text_input","z":"f1c196de.aec348","name":"","label":"","tooltip":"","group":"e386b8e689808f14","order":0,"width":0,"height":0,"passthru":true,"mode":"text","delay":300,"topic":"topic","topicType":"msg","x":1060,"y":1160,"wires":[[]]},{"id":"6513288a6084ab44","type":"ui_text_input","z":"f1c196de.aec348","name":"","label":"","tooltip":"","group":"cd2099b85617de6d","order":0,"width":0,"height":0,"passthru":true,"mode":"text","delay":300,"topic":"topic","topicType":"msg","x":1060,"y":1340,"wires":[[]]},{"id":"50beebadaca20e79","type":"ui_text_input","z":"f1c196de.aec348","name":"","label":"","tooltip":"","group":"6791309b002b5e23","order":0,"width":0,"height":0,"passthru":true,"mode":"text","delay":300,"topic":"topic","topicType":"msg","x":1060,"y":1020,"wires":[[]]},{"id":"554643eec03d3cfb","type":"ui_text_input","z":"f1c196de.aec348","name":"","label":"","tooltip":"","group":"6791309b002b5e23","order":0,"width":0,"height":0,"passthru":true,"mode":"text","delay":300,"topic":"topic","topicType":"msg","x":1060,"y":1060,"wires":[[]]},{"id":"4938f333a7a2816e","type":"ui_text_input","z":"f1c196de.aec348","name":"","label":"","tooltip":"","group":"e386b8e689808f14","order":0,"width":0,"height":0,"passthru":true,"mode":"text","delay":300,"topic":"topic","topicType":"msg","x":1060,"y":1200,"wires":[[]]},{"id":"b28579ba0c43e9ba","type":"ui_text_input","z":"f1c196de.aec348","name":"","label":"","tooltip":"","group":"e386b8e689808f14","order":0,"width":0,"height":0,"passthru":true,"mode":"text","delay":300,"topic":"topic","topicType":"msg","x":1060,"y":1240,"wires":[[]]},{"id":"e0f2ad8fb86e268a","type":"ui_text_input","z":"f1c196de.aec348","name":"","label":"","tooltip":"","group":"cd2099b85617de6d","order":0,"width":0,"height":0,"passthru":true,"mode":"text","delay":300,"topic":"topic","topicType":"msg","x":1060,"y":1380,"wires":[[]]},{"id":"31e3823a7b1b97c1","type":"ui_text_input","z":"f1c196de.aec348","name":"","label":"","tooltip":"","group":"cd2099b85617de6d","order":0,"width":0,"height":0,"passthru":true,"mode":"text","delay":300,"topic":"topic","topicType":"msg","x":1060,"y":1420,"wires":[[]]},{"id":"fd102484e884f383","type":"ui_text_input","z":"f1c196de.aec348","name":"","label":"","tooltip":"","group":"06599b9d50fb496a","order":0,"width":0,"height":0,"passthru":true,"mode":"text","delay":300,"topic":"topic","topicType":"msg","x":1060,"y":880,"wires":[[]]},{"id":"296a017e4f47aea2","type":"function","z":"f1c196de.aec348","name":"Gelber Sack","func":"if (msg.payload.diffDays === 1) {\n msg.payload = true;\n} else {\n msg.payload = false;\n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":890,"y":760,"wires":[["45f38632fc7c438f"]]},{"id":"e0aa04c4bd95d0c1","type":"function","z":"f1c196de.aec348","name":"Biotonne","func":"if (msg.payload.diffDays === 1) {\n msg.payload = true;\n} else {\n msg.payload = false;\n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":880,"y":940,"wires":[["1e3c5b386a6956ae"]]},{"id":"5552188f551028c2","type":"function","z":"f1c196de.aec348","name":"Hausmüll","func":"if (msg.payload.diffDays === 1) {\n msg.payload = true;\n} else {\n msg.payload = false;\n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":880,"y":1120,"wires":[["5fc1baa55c5a9e52"]]},{"id":"9c4dc7bc6839d11d","type":"function","z":"f1c196de.aec348","name":"Papiertonne","func":"if (msg.payload.diffDays === 1) {\n msg.payload = true;\n} else {\n msg.payload = false;\n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":890,"y":1300,"wires":[["6bf0c14ef3b39705"]]},{"id":"78aadf11ce28b631","type":"change","z":"f1c196de.aec348","name":"Nachricht","rules":[{"t":"change","p":"payload","pt":"msg","from":"true","fromt":"bool","to":"Gelber Sack wird morgen abgeholt","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1160,"y":760,"wires":[["a8d67814532fa0ae","9731562dffc3e9ce"]]},{"id":"1228fb13935a8453","type":"change","z":"f1c196de.aec348","name":"Nachricht","rules":[{"t":"change","p":"payload","pt":"msg","from":"true","fromt":"bool","to":"Biotonne wird morgen abgeholt","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1160,"y":940,"wires":[["a8d67814532fa0ae","9731562dffc3e9ce"]]},{"id":"b87ca50236c28f53","type":"change","z":"f1c196de.aec348","name":"Nachricht","rules":[{"t":"change","p":"payload","pt":"msg","from":"true","fromt":"bool","to":"Hausmüll wird morgen abgeholt","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1160,"y":1120,"wires":[["a8d67814532fa0ae","9731562dffc3e9ce"]]},{"id":"1cc15120ce5251c4","type":"change","z":"f1c196de.aec348","name":"Nachricht","rules":[{"t":"change","p":"payload","pt":"msg","from":"true","fromt":"bool","to":"Papiertonne wird morgen abgeholt","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1160,"y":1300,"wires":[["a8d67814532fa0ae","9731562dffc3e9ce"]]},{"id":"45f38632fc7c438f","type":"switch","z":"f1c196de.aec348","name":"","property":"payload","propertyType":"msg","rules":[{"t":"true"},{"t":"false"}],"checkall":"true","repair":false,"outputs":2,"x":1030,"y":760,"wires":[["78aadf11ce28b631"],[]]},{"id":"1e3c5b386a6956ae","type":"switch","z":"f1c196de.aec348","name":"","property":"payload","propertyType":"msg","rules":[{"t":"true"},{"t":"false"}],"checkall":"true","repair":false,"outputs":2,"x":1030,"y":940,"wires":[["1228fb13935a8453"],[]]},{"id":"5fc1baa55c5a9e52","type":"switch","z":"f1c196de.aec348","name":"","property":"payload","propertyType":"msg","rules":[{"t":"true"},{"t":"false"}],"checkall":"true","repair":false,"outputs":2,"x":1030,"y":1120,"wires":[["b87ca50236c28f53"],[]]},{"id":"6bf0c14ef3b39705","type":"switch","z":"f1c196de.aec348","name":"","property":"payload","propertyType":"msg","rules":[{"t":"true"},{"t":"false"}],"checkall":"true","repair":false,"outputs":2,"x":1030,"y":1300,"wires":[["1cc15120ce5251c4"],[]]},{"id":"06599b9d50fb496a","type":"ui_group","name":"Gelber Sack","tab":"372caf308a3378d6","order":1,"disp":true,"width":"6","collapse":false},{"id":"6791309b002b5e23","type":"ui_group","name":"Biotonne","tab":"372caf308a3378d6","order":2,"disp":true,"width":"6","collapse":false},{"id":"e386b8e689808f14","type":"ui_group","name":"Hausabfall","tab":"372caf308a3378d6","order":3,"disp":true,"width":"6","collapse":false},{"id":"cd2099b85617de6d","type":"ui_group","name":"Papiertonne","tab":"372caf308a3378d6","order":4,"disp":true,"width":"6","collapse":false},{"id":"372caf308a3378d6","type":"ui_tab","name":"Müllabfuhr","icon":"dashboard","order":17,"disabled":false,"hidden":false}]