Date Creation: :date
Creates a date from a string or retrieves the current date/time.
"2024-01-15T00:00:00.000Z") and YYYY-MM-DD format ("2024-01-15") are automatically parsed as dates.
The system variable {$today} is also available in inline expressions for the current date.
Date Formatting: :format-date
Formats a date according to a pattern string.
Pattern Characters
| Character | Description |
|---|---|
Y | Year, 4 digits |
y | Year, 2–4 digits |
M | Month, 2 digits (zero-padded) |
m | Month, 1–2 digits |
D | Day, 2 digits (zero-padded) |
d | Day, 1–2 digits |
x | Any non-digit separator |
Inline Formatting with Pipes
For quick formatting inside strings, use theformatDdMmYyyy pipe:
Date Comparison
Using :cmp
Combine :cmp with dates and the | age pipe for age-based conditions:
:eq, :neq, :gt, :gte/:ge, :lt, :lte/:le.
Inline Date Comparisons
Simple date comparisons can be expressed directly inside strings:Date Difference: :diff
Calculates the difference between two dates in a specified unit.
Available Comparators
| Comparator | Returns |
|---|---|
"day" | Number of days between the dates |
"hour" | Number of hours |
"minute" | Number of minutes |
"second" | Number of seconds |
Age Calculation: | age
Calculates the age in years from a date value. Available as an inline pipe.
:cmp for eligibility rules:
Date Arithmetic: :sum with Dates
Add or subtract time from dates using duration strings.
Single duration:
Supported Duration Units
| Unit | Example | Description |
|---|---|---|
| Days | "2d", "3d" | Add days |
| Hours | "72h" | Add hours |
| Years | "2y" | Add years |
Raw Numbers and Strings
- Raw numbers are treated as milliseconds. Negative numbers subtract time.
- Numeric strings (e.g.,
"+86400") are treated as seconds.