T
TanStack17mo ago
rival-black

Filter not working properly

Hello, So i'm trying to filter a date, but the problem is, the date is a string and not an actual date (image sample) the main question I want to ask is, is there any possible way that I can get the value and convert it to a date before passing it to the DataTableColumnHeader (from shadcn) ?
{
accessorKey: "dateOfEvent",
header: ({ column }) => {

return (
<DataTableColumnHeader column={column} title="Event Date" />
)
},
},
{
accessorKey: "dateOfEvent",
header: ({ column }) => {

return (
<DataTableColumnHeader column={column} title="Event Date" />
)
},
},
No description
1 Reply
quickest-silver
quickest-silver17mo ago
yeah, for dates, using an accessorFn to convert the date to whatever date format you need is much more common.

Did you find this page helpful?