Skip to main content

BusinessRuleDateExpression

Date and time expression for temporal comparisons and date-specific operations.

Provides comprehensive temporal comparison capabilities including absolute date comparisons, relative date calculations, and time-based conditions. Supports both date-only and datetime operations with flexible offset calculations from current time.

type BusinessRuleDateExpression implements IBusinessRuleExpression {
id: ID!
type: BusinessRuleExpressionTypes!
number: Int
date: DateTime
string: String
operator: BusinessRuleDateExpressionOperators!
path: String
}

Fields

BusinessRuleDateExpression.id ● ID! non-null scalar

Unique identifier for this expression within the business rule system

BusinessRuleDateExpression.type ● BusinessRuleExpressionTypes! non-null enum

Data type classification of the expression determining available operators and validation rules

BusinessRuleDateExpression.number ● Int scalar

Numeric offset value for relative date calculations.

Used with operators that calculate relative dates:

  • Days from today (positive for future, negative for past)
  • Minutes from now for precise time calculations
  • Day of week (1-7, Monday=1), day of month (1-31), month of year (1-12)

BusinessRuleDateExpression.date ● DateTime scalar

Absolute date value for direct date comparisons (used with 'before' and 'after' operators)

BusinessRuleDateExpression.string ● String scalar

Time value in 24-hour format (HH:MM:SS) for time-based operators like 'onTime', 'beforeTime', 'afterTime'

BusinessRuleDateExpression.operator ● BusinessRuleDateExpressionOperators! non-null enum

Temporal comparison operator defining how the date/time value should be evaluated against the target field

BusinessRuleDateExpression.path ● String scalar

Path to the field, can be used to add additional expressions and calulations on the field. Use $ to target the field's value. When omitted the field's value is used. The expression will be used on the left hand side of the operator. Can also be used to target a specific property in a complex expression's sub-expression Check https://gorules.io/docs/rules-engine/expression-language/date-and-time for options.

Interfaces

IBusinessRuleExpression interface

Base interface for all business rule expression types defining common properties and behavior.

Expressions are the fundamental building blocks for business rule conditions and calculations. Each expression type provides specific operators and validation logic for different data types including strings, numbers, dates, arrays, and complex aggregations.