I don't know why is appearing this error, some help please.
This is my full function...
const time = new Date(msg.payload);
const hour = time.getHours();
const minute = time.getMinutes();
let timef = "";
if(minute<10){
if(hour>9){
timef = String(hour) + ":0" + String(minute);
} else {
timef = "0"+ String(hour) + ":0" + String(minute);
}
} else {
if(hour>9){
timef = String(hour) + ":" + String(minute);
} else {
timef = "0"+ String(hour) + ":" + String(minute);
}
}
const msgOut = flow.get("msgOut");
msgOut.forEach(element => {
if(element.time == timef) node.send({payload:element.command,item:element.item});
});
node.done();
return;