OK, I believe you can use node-red-contrib-moment to do such things. Or you could do it in javascript using the Date functions to get the individual parts and build the string.
let date = new Date(startDay).toISOString().split('T')[0]
startDay = date.split('-')[2] + '-' + date.split('-')[1] + '-' + date.split('-')[0]
date = new Date(endDay).toISOString().split('T')[0]
endDay = date.split('-')[2] + '-' + date.split('-')[1] + '-' + date.split('-')[0]
gives
"28-02-2005"
or probably better
let day = new Date("2005-03-01"); //YYYY-MM-DD
let end = new Date("2005-03-03");
while(day <= end){
let startDay = day.setDate(day.getDate() - 1);
let endDay = day.setDate(day.getDate() + 1);
msg.payload= {
"startDay": timeStampToDate(startDay),
"endDay": timeStampToDate(endDay)
}
node.send(msg);
day = new Date( day.setDate(day.getDate() + 1) )
}
function timeStampToDate(timeStamp) {
let date = new Date(timeStamp).toISOString().split('T')[0]
return date.split('-')[2] + '-' + date.split('-')[1] + '-' + date.split('-')[0]
}