Loading TOC...

MarkLogic 9 Product Documentation
cts.periodCompare

cts.periodCompare(
   period-1 as cts.period,
   operator as String,
   period-2 as cts.period
) as Boolean

Summary

Compares two periods using the specified comparision operator. Returns true if the two periods meet the operator conditions or false if they do not meet the conditions.

Parameters
period-1 The first period to compare.
operator A comparison operator.
period-2 The second period to compare against the first.

Example

var period1 = cts.period(xs.dateTime("2000-05-31T09:30:10-08:00"),
                           xs.dateTime("2003-05-31T09:30:10-08:00"));
var period2 = cts.period(xs.dateTime("2003-05-31T09:30:10-08:00"), 
                           xs.dateTime("2004-05-31T09:30:10-08:00"));
cts.periodCompare(period1, "aln_meets", period2);

  => true

Stack Overflow iconStack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.