Comparions

Between

Validates if the input is between two numbers

v.val(25,"between 18 and 60"); // true

Or two dates

v.val(v.date("2020-10-01"), "between 2020-01-01 and 2021-01-01")

Interval

Like between, validates the input is in the range.

The following rule has the same result as between 18 and 60

v.val(36,"[18..60]"); // true

Besides closed interval, Rebb Val also support open interval and half-open interval

v.val(60, "(18,60)"); // false
v.val(60, "(18,60]"); // true
 
v.val(18, "(18,60)"); // false
v.val(18, "[18,60)"); // true

You can use date interval like this

v.val(v.date("2000-01-01"), "[2000-01-01..2000-12-31]"); // true

Equals

v.val(10,"=10"); // true

Not Equal

v.val(100,"!=10"); // true

Greater than

v.val(10,">10"); // false

Greater than and equal

v.val(10, ">=10"); // true

Less than

v.val(10,"<10"); // false

Less than and equal

v.val(10, "<=10"); // true

Last updated

Was this helpful?