Hi, there!
stuck while comparing date. I’m using IF or FILTER nodes and get error.
if i choose to compare in string format it works, but string format can’t
What is the error message (if any)?
Comparison type expects a dateTime but both fields are a string use " is after or equal to" operation
Please share your workflow
Input (value 1): formattedDate from json as string, convert to date format
{{ DateTime.fromFormat($json.formattedDate, “dd-MM-yyyy”).toFormat(“dd-MM-yyyy”) }}
toFormat() will convert the date objects to strings, so in your IF node you need to compare as strings, not dates. You other option is to use the date compare node
and in cloud version i don’t have such issue, i’ve just copied workflow to self-hosted
about fromISO() i’ve got an answer from n8n Assistant )
To convert a string in the format dd-MM-yyyy (for example, “23-06-2019”) to a date in n8n, you should use Luxon’s fromFormat() function, not fromISO(). The fromISO() function is only for ISO 8601 date strings (like “2019-06-23T00:00:00.00”).