-
Is there a method to enable the json-rules-engine to determine "if current date is lessThan 2025-06-30"? I can pass the current date as a fact, but how can I compare a date similar to how you can compare numbers? |
Beta Was this translation helpful? Give feedback.
Answered by
Ben-CA
Jan 28, 2025
Replies: 1 comment 5 replies
-
Looks like I can just add the current date as a fact:
And then reference that in my rule as so:
Seems to work just fine. :) Note - there can be some time zone issues with UTC dates, in case anyone is referring to this in the future. |
Beta Was this translation helpful? Give feedback.
5 replies
Answer selected by
Ben-CA
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Looks like I can just add the current date as a fact:
currentDate: new Date().toISOString().split('T')[0]
And then reference that in my rule as so:
Seems to work just fine. :)
Note - there can be some time zone issues with UTC dates, in case anyone is referring to this in the future.