Date filters
DateRangeFilter
Section titled “DateRangeFilter”Filters by comparing a field to a range of date values.
Filter schema
Section titled “Filter schema”Property | Type | Description |
---|---|---|
operator | RangeOperators | The operator to apply to the filter value |
value | range object | The value to use for the filter operation |
Range object
Section titled “Range object”Property | Type | Description |
---|---|---|
min | isoDate or utcDateTime | The minimum date value for this range |
max | isoDate or utcDateTime | The maximum date value for this range |
Formats
Section titled “Formats”A JSON example of this field is:
{ "operator": "between", "value": { "min": "2021-01-01", "max": "2021-01-02" }}
The JSON schema for this field is:
$schema: https://json-schema.org/draft/2020-12/schema$id: DateRangeFilter.yamltype: objectproperties: operator: $ref: RangeOperators.yaml description: The operator to apply to the filter value value: type: object properties: min: anyOf: - $ref: isoDate.yaml - type: string format: date-time max: anyOf: - $ref: isoDate.yaml - type: string format: date-time required: - min - max examples: - min: 2021-01-01 max: 2021-01-02 description: The value to use for the filter operationrequired: - operator - valuedescription: Filters by comparing a field to a range of date values
The TypeSpec code for this field is:
/** Filters by comparing a field to a range of date values */model DateRangeFilter { /** The operator to apply to the filter value */ operator: RangeOperators;
/** The value to use for the filter operation */ @example(#{ min: Types.isoDate.fromISO("2021-01-01"), max: Types.isoDate.fromISO("2021-01-02"), }) value: { min: Types.isoDate | utcDateTime; max: Types.isoDate | utcDateTime; };}
DateComparisonFilter
Section titled “DateComparisonFilter”Filters by comparing a field to a date value.
Property | Type | Description |
---|---|---|
operator | ComparisonOperators | The operator to apply to the filter value |
value | isoDate or utcDateTime | The value to use for the filter operation |
Formats
Section titled “Formats”A JSON example of this field is:
{ "operator": "eq", "value": "2021-01-01"}
The JSON schema for this field is:
$schema: https://json-schema.org/draft/2020-12/schema$id: DateComparisonFilter.yamltype: objectproperties: operator: $ref: ComparisonOperators.yaml description: The operator to apply to the filter value value: anyOf: - $ref: isoDate.yaml - type: string format: date-time - type: string format: date-time description: The value to use for the filter operationrequired: - operator - valuedescription: Filters by comparing a field to a date value
The TypeSpec code for this field is:
/** Filters by comparing a field to a date value */model DateComparisonFilter { /** The operator to apply to the filter value */ operator: ComparisonOperators;
/** The value to use for the filter operation */ @example(Types.isoDate.fromISO("2021-01-01")) value: Types.isoDate | utcDateTime | offsetDateTime;}