filter.nodes.dateRange
dateRange(spec: DateRangeSpec): FilterHandle<DateRangeSpec>Date range filter on a node property.
Hides nodes whose property value falls outside [after, before]. Accepts Date, ISO string, or millisecond timestamp inputs; the entry stores millisecond timestamps. Omitted bounds default to -Infinity / +Infinity. Invalid date strings fall back to the open bound. granularity is forwarded for downstream playback / UI alignment.
spec.property | string | Node property name to filter on. |
spec.after | Date | string | number | Lower bound (inclusive). Accepts Date, ISO string, or ms timestamp. |
spec.before | Date | string | number | Upper bound (inclusive). Accepts Date, ISO string, or ms timestamp. |
spec.granularity | DateGranularity | Granularity hint for playback / UI alignment (year/month/day/hour/minute/second). |
spec.on | string | string[] | '*' | Restrict to a subset of node categories. Default: '*' (all). |
spec.includeNull | boolean | Keep nodes missing the property. Default: true. |
spec.invert | boolean | Invert pass/fail. Default: false. |
spec.id | string | Override the auto-generated handle id. |
Returns: FilterHandle<DateRangeSpec>
Example
const recent = api.filter.nodes.dateRange({
property: "createdAt",
after: "2024-01-01",
before: new Date(),
granularity: "day",
});
// Advance the window
recent.update({ after: "2024-06-01" });