Skip to content
/ .. / .. /
Date Comparison Rule










Date Comparison Rule

This rule is used to check the date from a ticket against another date and may specify a locale and/or date format.

Syntax

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
check <property String> and <date Date|Number> within <number Number|String> <unit TimeUnit>;
check <property String> and <date Date|Number> within <number Number|String> <unit TimeUnit> if present;

// Specifies date format
check <property String> with format <dateFormat String> and <date Date|Number> within <number Number|String> <unit TimeUnit>;
check <property String> with format <dateFormat String> and <date Date|Number> within <number Number|String> <unit TimeUnit> if present;

// Specifies date format and locale
check <property String> with format <dateFormat String> locale <locale String> and <date Date|Number> within <number Number|String> <unit TimeUnit>;
check <property String> with format <dateFormat String> locale <locale String> and <date Date|Number> within <number Number|String> <unit TimeUnit> if present;

Parameters

  • property - The ticket property being checked, which must resolve to a String representation of a Date.

  • date - The date that property is being compared with. Must resolve to a Date or a Number (Epoch milliseconds).

  • number - The number of units. Must resolve to a Number or a String representation of a Number.

  • unit - Must be one of millisecond, milliseconds, second, seconds, minute, minutes, hour, hours, day or days.

  • dateFormat (Optional) - The date format.

  • locale (Optional) - The locale. If specifying a locale, dateFormat must also be used.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
check "Call_Start" and ${ctx.dateFromOtherSteps} within 2 minutes;
check "Call_Start" and ${ctx.dateFromOtherSteps} within 2 minutes if present;

// Specifies date format
check "Call_End" with format "YYYY.mm.dd HH:MM" and ${ctx.dateFromOtherSteps}
within 1002 milliseconds;
check "Call_End" with format "YYYY.mm.dd HH:MM" and ${ctx.dateFromOtherSteps}
within 1002 milliseconds if present;

// Specifies date format and locale
check "Call_End" with format "YYYY.mm.dd HH:MM" locale "tr_TR"
and ${ctx.dateFromOtherSteps} within 1002 milliseconds;
check "Call_End" with format "YYYY.mm.dd HH:MM" locale "tr_TR"
and ${ctx.dateFromOtherSteps} within 1002 milliseconds if present;