Trying to get something done based on the date.
In this example the collection date is the 13th and today is the 10th, but for some reason it's is marking the if statement as true.
var now = new Date().getDate()
var collectday = new Date(msg.payload.attributes.start_time).getDate()
var datedif = collectday - now
if (0 < datedif <= 1) {
return [msg, null]
} else {
return [null, msg]
}
Basically what I am trying to do is to see if msg.payload.attributes.start_time is tomorrow, if it is tomorrow than I have other stuff in my flow, if not it will go to the second output that goes no where.
So I think I am going to go with something like yours, I'll just do -1 to the collection date then check if they are equal instead.