Can you show us what you have so far?
I created 2 helpers for my purpose, and update both of them:
[{"id":"f81bfc9915a597c4","type":"api-call-service","z":"f0f8b65fdf86ec43","name":"","server":"50e96ec2.27ea9","version":5,"debugenabled":false,"domain":"input_text","service":"set_value","areaId":[],"deviceId":[],"entityId":["input_text.duty_this_week"],"data":"{\"value\":\"{{payload}}\"}","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":480,"y":120,"wires":[[]]},{"id":"4a4de24a872edfb2","type":"api-call-service","z":"f0f8b65fdf86ec43","name":"","server":"50e96ec2.27ea9","version":5,"debugenabled":false,"domain":"input_text","service":"set_value","areaId":[],"deviceId":[],"entityId":["input_text.duty_next_week"],"data":"{\"value\":\"{{payload}}\"}","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":480,"y":200,"wires":[[]]},{"id":"cdb1728e17b0ef07","type":"function","z":"f0f8b65fdf86ec43","name":"Next Week","func":"let today = dayjs().add(7, 'days');\nvar i = 0;\nfor (i = 0; i < msg.payload.object.dayNightMode.overrides.length; i++) {\n var startdate = new Date(msg.payload.object.dayNightMode.overrides[i].startOverrideDateTime);\n var enddate = new Date(msg.payload.object.dayNightMode.overrides[i].endOverrideDateTime);\n if (today > startdate && today < enddate) {\n msg.payload = msg.payload.object.dayNightMode.overrides[i].overridePhoneLine.commonName.substring(6);\n return msg;\n }\n}\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[{"var":"dayjs","module":"dayjs"}],"x":270,"y":200,"wires":[["4a4de24a872edfb2"]]},{"id":"78e28f634d72e091","type":"function","z":"f0f8b65fdf86ec43","name":"This Week","func":"let today = dayjs();\nvar i = 0;\nfor (i = 0; i < msg.payload.object.dayNightMode.overrides.length; i++) {\n var startdate = new Date(msg.payload.object.dayNightMode.overrides[i].startOverrideDateTime);\n var enddate = new Date(msg.payload.object.dayNightMode.overrides[i].endOverrideDateTime);\n if (today > startdate && today < enddate) {\n msg.payload = msg.payload.object.dayNightMode.overrides[i].overridePhoneLine.commonName.substring(6);\n return msg;\n }\n}\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[{"var":"dayjs","module":"dayjs"}],"x":270,"y":120,"wires":[["f81bfc9915a597c4"]]},{"id":"3f9b6a631605c51f","type":"json","z":"f0f8b65fdf86ec43","name":"","property":"payload","action":"","pretty":false,"x":90,"y":160,"wires":[["78e28f634d72e091","cdb1728e17b0ef07"]]},{"id":"50e96ec2.27ea9","type":"server","name":"Home Assistant","version":4,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true,"heartbeat":false,"heartbeatInterval":"30","areaSelector":"friendlyName","deviceSelector":"friendlyName","entitySelector":"friendlyName","statusSeparator":"at: ","statusYear":"hidden","statusMonth":"short","statusDay":"numeric","statusHourCycle":"h23","statusTimeFormat":"h:m"}]