Date Math / relevance substitution failing

The issue is that when I test my relevance substitution in the Fixlet Debugger, it works but when I put it in a task, it fails.

What I am trying to do:

First, I am converting dates to integers so we can do math on them, is date one greater than date two. You can do this if you use the format YYYYMMDD.

The plan is to enter a date into a registry key and make tasks relevant to them based on the date entered. However, the task to actually make that registry entry need some validation. This is what I have, before the problem line…

// Query for Expirey date
action parameter query "SetExpire" with description "Please enter the Expiry date, in format YYYYMMDD (Ex. 20250125) :" With default ""
//Verify the data entered is valid, 8 digist long (YYYYMMDD) and starts with the year 202?
continue if { exists (parameter "SetExpire" of action) whose (length of it as integer = 8) }
continue if { substring (0,3) of (parameter "SetExpire" of action) = "202" }

Now I want to verify that the date is in the future, not the past.
In the fixlet debugger, it works. In the task, it fails.

But it fails in the task…

image

At a loss. Hoping someone has some input. Thanks in advance.

Tagging @Ftoole , he helped me on some of this.

Should there be an exists in front of that parameter? I e. exists parameter "something" whose ()

If I add it, I get “This expression contained a character which is not allowed.”

In the debugger.
image

In the task, it also failed.

Try simplifying the relevance:

continue if { parameter "SetExpire" of action as integer > (year of it as string & month of it as two digits & day_of_month of it as two digits) of current date as integer}

2 Likes

The word of the day is “KISS”

Keep it Simple Stupid. I guess I over complicate things sometimes.

Yes, that worked.

Thanks.