Property description

The rules block on the date component enforces a conditional max-future-date limit. The allowed date range is determined by the current value of a driver attribute on the same record. Each driver value maps to a limit expressed in years or days from today. If the driver attribute is empty or its value does not match any threshold, the fallback limit applies.

Example JSON

{
    "rules": {
        "driverAttributeTypeKey": "regulation_flag",
        "thresholds": [
            {
                "driverValue": "YES",
                "limit": {
                    "kind": "years",
                    "value": 3
                },
                "errorTranslationKey": "effective_from.error.max_3y"
            },
            {
                "driverValue": "NO",
                "limit": {
                    "kind": "years",
                    "value": 6
                },
                "errorTranslationKey": "effective_from.error.max_6y"
            }
        ],
        "fallback": {
            "limit": {
                "kind": "none"
            }
        }
    }
}

Nested properties

PropertyDescriptionValuesMandatory
driverAttributeTypeKeyKey of the attribute on the same record whose value determines which threshold is active.stringYes
thresholdsOrdered list of value-to-limit mappings. At least one entry is required. Matched by exact comparison against the driver attribute value. See thresholds properties.arrayYes
fallbackLimit applied when the driver attribute is empty or its value does not match any threshold. Shape: { limit, errorTranslationKey? }.jsonYes

thresholds properties

PropertyDescriptionValuesMandatory
driverValueThe driver attribute value that activates this threshold. Exact match. Type follows the driver attribute (string, boolean, or integer).string / boolean / integerYes
limitThe max-future-date limit when this threshold is active. See limit kinds.jsonYes
errorTranslationKeyTranslation key for the inline validation error shown when the date exceeds this limit. If omitted, a generic platform error is used.stringNo

limit kinds

kindShapeDescription
days{ "kind": "days", "value": <positive int> }Date must be at most today + N days.
none{ "kind": "none" }No restriction — picker is open for any future date. When used as the fallback limit, no validation error is ever generated.
years{ "kind": "years", "value": <positive int> }Date must be at most today + N years.

Example

Behavior notes

  • The active limit recalculates in real time when the driver attribute changes within the same form session.
  • If changing the driver attribute causes an already-set date to exceed the new limit, saving is blocked until the user corrects the date or reverts the driver.
  • Existing records with dates beyond a newly configured limit are not affected. The rule activates only when the user next edits either the date or the driver attribute on that record.