dateColumn
function dateColumn<F>(options?): TableColumnSpec<DatePresetValue, "date", NoInfer<F>>;Defined in: filters/tanstack-table.ts:466
A date preset picker: the value is a DatePresetValue (e.g. “this
month”, or a between range with end) and becomes a date filter. With
timeZone, the value may omit it (and fromFilter leaves it out again
when it matches). The preset is resolved later by your resolveDate.
Type Parameters
Section titled “Type Parameters”| Type Parameter | Default type |
|---|---|
F extends string | undefined |
undefined |
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
options? |
FieldOption<F> & object |
Returns
Section titled “Returns”TableColumnSpec<DatePresetValue, "date", NoInfer<F>>
Example
Section titled “Example”import { dateColumn } from "@xtandard/lib/filters/tanstack-table";
const createdAt = dateColumn({ timeZone: "Europe/Madrid" });createdAt.toFilter({ operator: "is", unit: "month", anchor: "2026-02-01T00:00:00" });// → { kind: "date", operator: "is", unit: "month", timeZone: "Europe/Madrid", anchor: "2026-02-01T00:00:00" }createdAt.toFilter({ operator: "is", unit: "fortnight", anchor: "2026-02-01T00:00:00" }); // → null