Products Downloads


French version


 

This function returns "true" if two intervals have a non-empty intersection, "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. The two intervals must be of the same type.

When the bound type of both intervals 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

Interval1

Interval to test

Mandatory

String/Number/Date/Time/Date-time sequence

Interval2

Interval to test

Mandatory

Hash

opts

Definition of intersection options. This object can have the following attributes:

  • "stringComp": alphanumeric string. Used to define the comparison mode for two String-type values. Two possible values:
      • "lexico": lexicographic comparison (by default)
      • "localeBased": comparison using a collation
  • "collator": if "stringComp" is "localeBased", this attribute describes the collation used. By default, the collation is associated with the template execution locale. By default, the "strength" and "decomposition" attributes have values which depend on the locale. The collation is a hash object with the following attributes:
      • "locale": string in IETF BCP 47 format identifying a locale for the comparison,
      • "strength": string representing the strength of the collation to determine the level of difference considered as significant in the comparisons. Five values are provided: "identical", "primary", "secondary", "tertiary" and "quaternary",
      • "decomposition": string representing the collation decomposition mode. It determines the processing of Unicode combining characters. Setting the decomposition mode enables the user to choose between a quicker and fuller classification behavior. Three values are provided: "no_decomposition", "canonical_decomposition" and "full_decomposition"

Optional.

 


For example

<#assign planningTask1 = ["2018-05-10"?date.xs, "2018-06-10"?date.xs] />
<#assign planningTask2 = ["2018-05-30"?date.xs, "2018-06-20"?date.xs] />
<#if hardisCore.intervalIntersects (planningTask1, planningTask2)>
Check if we have enough resources
</#if>

↑ Top of page