Date Condition for one week before and after one days of the verify date

Hello guys, I have faced some issue on the setting the date. Have anyone can help me to solve the problem. Thanks so much

Basically my flow is the user need to select a date on form submission, then it will go to read the sheets where I have store the user’s email. So here will go to two if node, which the top is before one week need to send reminder for the user and another is delay date. The behind if is reminder before 3 days.

For example, if user select 2025-07-17, so the two condition will appear separately come out 2025-07-10 and 2025-07-18.

I think that the problem is come out on the date condition that I really don’t know how to fix it. Hope that have guys can help me. Thanks

Hi @Joe_B

In n8n we can use Luxon for these kind of things.
For example this will give you the start of the week:
DateTIme.fromISO($json.datefield).startOf("week").toISODate()

I did not find out the Luxon in the node

Luxon is a library u can use in expression. Date and time with Luxon | n8n Docs
There is also a DateTime node that does some Date conversions.

Can you make an example for me?

{{
$luxon.DateTime
.fromISO($(‘On form submission’).item.json[‘Date to Verify’])
.minus({ days: 7 })
.toISODate()
}}

Just now I have try this is not correct

{{
DateTime.fromISO($(‘On form submission’).item.json[‘Date to Verify’]).minus({ days: 7 }).toISODate()
}}

it will not automatically to change the day before one week.

when user select 2025-07-07, the date condition will show before one week which means is 2025-07-01(it did not show the date, it show back 2025-07-17 that I setting before), it will not show that correct date

Just now I have try using the switch node, but it is fail since it cannot come out the output.

please provide some sample data and workflow so we can help you out.

dont have the sample data. I just click on the on form submission and select the date to test the if condition node for date. Bez I have link to email so if successful the email will get the message

Can you based on my flowchart and make some adjustments?

just give us some example inputs and needed outputs As you are not being clear in what you want and the example I gave should already have helped with what you want to do.

First thing first, if user select 2025-07-24 on “on form submission”, so it will go to the if condition. The first condition I put before 7 days which means if it detect the date is 2025-07-17, it will send a reminder via email. Otherwise no operation. Another if condition at the behind is reminder before 3 days which means is 2025-07-21 will send again the reminder to the user.

Another example if user select 2025-07-08 on “on form submission”, so it will go to the if condition. The first condition I put before 7 days which means if it detect the date is 2025-07-01, it will send a reminder via email. Otherwise no operation. Another if condition at the behind is reminder before 3 days which means is 2025-07-05 will send again the reminder to the user.

The after date of “on form submission” concept will same like the before 7 days condition, so can just ignore it.

So I think now my faced problem is the second expression, because now I look that it already fixed that, not flexible on the user have select date “on form submission”.

So something like this:

{{ $json["Date to Verify"] }}
is before or equal to
{{ DateTime.fromISO($json["Date to Verify"]).minus({days:7}).toISODate() }}

Still cannot work. How can I take my flowchart like this format so that you able to see the my overal; flow and know which stage have problem?

you can paste your workflow here, by selecting everything and then pasting it within a code block.

type or paste code here

top option:

Ah sorry your logic is totally wrong as it will always be false.
I guess you want to check if it is from 7days ago from today?

{{ $today.minus({days:7}).toISODate() }}

not must today, is to see the user have select which date

If user select 07-07, then one week before is 07-01. We don’t know the user will select which date, we can just fixed the before one week that user select