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

Equals

Not Equal

Greater than

Greater than and equal

Less than

Less than and equal

Last updated

Was this helpful?