Add an "Is between" operand for date filters

Merged
FE
5d ago
+1124-57

Why

A range of days is today expressed as two conditions, IS_AFTER + IS_BEFORE. Every consumer that wants "one date range" then has to detect, build and keep that pair together (chart drilldowns already do, and dashboard filters would have to). This adds a single operand so a range is one condition everywhere filters exist.

What

Operand and value

  • IS_BETWEEN on ViewFilterOperand, RowLevelPermissionPredicateOperand and CoreWorkflowFilterOperand, available on DATE and DATE_TIME.
  • The value is a stringified {"start":"2026-12-01","end":"2026-12-31"}: plain days, both included, start on or before end. A one-day range has the same start and end.
  • On DATE_TIME the days are resolved in the filter time zone, exactly like IS already does.

Server and shared

  • Compiled in the shared filter compiler to gte start and lt end + 1 day, so views, chart filters and row-level permission rules all get it from one place.
  • Validated by a new dateRangeFilterValueSchema in FILTER_VALUE_SCHEMAS_MAP.
  • Evaluated in workflow filter steps and in the workflows list filter.
  • A fast instance command adds the value to the two Postgres enums with ALTER TYPE … ADD VALUE (no table rewrite).
  • OpenAPI, AI tool descriptions, the standard skill and the app developer docs list the operand and its value shape.

Front

  • DateRangePicker: start and end inputs above a calendar that highlights the range. Used by the filter dropdown and the advanced filter.
  • FormDateRangePicker: two date fields, used in the side panel advanced filter, workflow filter steps, permission rule conditions and the workflows list filter.
  • Switching a filter to or from "Is between" keeps the day it was set to.

Notes for review

  • Rollback: down deletes view filters that use IS_BETWEEN, and deliberately fails while a permission rule still uses it, since dropping or rewriting a rule would widen access.
  • Variables: the two bounds do not take workflow variables yet.
  • Not in this PR: numbers and currencies ("between 10 and 20"), and moving chart drilldowns from the after/before pair to this operand.
  • Translation catalogs are left to the i18n pipeline.

Testing

  • Unit tests added for the compiler (including a range crossing a daylight-saving change), the value schema, the workflow filter step and the workflows list predicate; operand-list tests and snapshots updated.
  • Exercised in the browser on a seeded workspace: opportunities filtered on close date between Dec 1 and Dec 31 return 49 records, matching a direct SQL count. Also checked the advanced filter and the workflows list filter.
  • Not exercised in the browser: the workflow filter step and the permission rule condition editor. They use the same FormDateRangePicker and are covered by type-check and unit tests only.

Generated by Claude Code