This function returns "true" if a value belongs to an interval, "false" if not.
The supported types are String/Number/Date/Time/Date-time.
An interval is a sequence of two values of the same type: the first value represents the lower bound and the second the upper bound. A value is contained in an interval if:
Lower bound <= value <= upper bound
When the value and interval type is String, the comparison mode is lexicographic. The "opts" parameter can be used to define a comparison using a collation enabling two character strings to be compared according to a given language.
Parameters
String/Number/Date/Time/Date-time sequence |
Interval |
Interval to test |
Mandatory |
String/Number/Date/Time/Date-time |
inOutVal |
Value to test |
Mandatory |
Hash |
opts |
Definition of dependency options This object can have the following attributes:
|
Optional. |
For example
<#assign holiday = ["2018-05-10"?date.xs, "2018-06-10"?date.xs] /> <#if hardisCore.intervalContains (holiday, .now?date)> I'll be back soon! </#if>