Skip to main content

Date Filter

Date filters provide a wide range of additional functionality. These features are available when the contentType DATE is used.

Example of a complete filter entry:

Date within (time span) "This week"

JSON representation of such a filter:

{
"type": "group",
"operator": "AND",
"childs": [
{
"type": "row",
"name": "ENTRYDATE",
"operator": "TIMEFRAME_EQUAL",
"value": "This week",
"key": "REL=ADJUSTED;UNIT=WEEK",
"contenttype": "DATE"
}
]
}

Filtering Relative Date Values

When working with filter values, there are two use cases that have special values because they are relative to the current date. This means a user can store a filter and the date will be resolved automatically at runtime when using, for example, a database-record-container.

warning

Always use the provided JDito methods to handle relative date expressions from filters. Otherwise, functionality may break after software updates and require manual adjustments (→ customizing after an update).


When do you need to handle relative date expressions yourself?

In any situation where the filters’ key is used within JDito Processes. For example:

  • filterExtensions and filterExtensionSets with contentType DATE
  • filtered fields with contentType DATE in non-database-record-containers
tip

The datetime.resolveRelativeDateExpression(...) function resolves the date expression into timestamp values at runtime.

Breaking Down the key

The key property alone is enough to express a relative date filter and can be broken down into the following parts:

REL - Specifies that this value is relative to the current date at runtime. The value determines how the date is resolved exactly. Possible values are:

  • ADJUSTED - Used for filters like "today", "this week", "past calendar week", etc.
  • FIXED - Used for filters like "past week" (the last seven days, not within the last calendar week)

Within (Time Span)

  • REL - The type, in this use-case always ADJUSTED
  • UNIT - The time unit. Possible values include: DAY, WEEK, MONTH, YEAR
  • optional OFFSET - Depending on the version you are using, the offset is set to zero OFFSET=0. This has only semantic meaning and doesn't change behavior.
Example: Within this calendar week
{
"type": "row",
"name": "ENTRYDATE",
"operator": "TIMEFRAME_EQUAL",
"value": "This calendar week",
"key": "REL=ADJUSTED;UNIT=WEEK",
"contenttype": "DATE"
}

Past / Coming

  • REL - The type, depends on the use case:

Filtering the Past or Coming Period of a given time unit from "now"

  • REL - The type, in this use-case always FIXED
  • START or END - The start or end of the time span, depending on whether past or coming is used
    • The value contains the number of the given time unit. START=P-21D for example means "The past 21 days" (the past 3 weeks)
    • Read it as: "the start is -21 days from now"

For this mode, the time is determined by the current date and time at execution.

Example: The Coming Two Months
{
"type": "row",
"name": "ENTRYDATE",
"operator": "TIMEFRAME_COMING",
"value": "2 Months",
"key": "REL=FIXED;END=P2M",
"contenttype": "DATE"
}

Filtering the Past or Coming Calendar Time Unit from "Now"

info

This feature requires ADITO version 2026.0.1 or newer.

  • REL - The type, always ADJUSTED
  • UNIT - The time unit. Possible values include: DAY, WEEK, MONTH, YEAR
  • OFFSET - The offset of the time unit
    • Positive values > 0 mean "in the future"
    • Negative values < 0 mean "in the past"
    • Zero (negative or positive) means "the current time unit"
Example: The Coming Two Calendar Years
{
"type": "row",
"name": "ENTRYDATE",
"operator": "TIMEFRAME_COMING",
"value": "2 Calendar years",
"key": "REL=ADJUSTED;UNIT=YEAR;OFFSET=2",
"contenttype": "DATE"
}