-
Notifications
You must be signed in to change notification settings - Fork 34
Open
Description
I have a problem when trying to compare dates within a range using the === operator. The current implementation does not support this.
range = Date.parse('2024-01-01')..Date.parse('2024-12-31')
date = Date.parse('2024-07-22')
rule = {
"===" => [
{ "var" => "range" },
{ "var" => "date" }
]
}
data = {
"date" => date,
"range" => range
}
result = JSONLogic.apply(rule, data)
# expected result is true, but in all cases it returns false
We could add the command "==="
'===' => ->(v, d) { v[0] == v[1] }, |
'===' => ->(v, d) { v[0] === v[1] },
kessystaub, DanielDz21, cesarjr, MatCRL and gabrieldeespindula
Metadata
Metadata
Assignees
Labels
No labels