You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
my activationDate maybe null sometimes and I tried fallbacking to undefined, null and empty string (which typescript doesn't permit) in accessorFn here, but filtering gets broken then.
It needs only supports date type so I could make it work only using epoch time but is there any other way to implement the logic here, if the provided date is null or undefined?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
I've got weird problem here on date range filter type:
{ accessorFn: (originalRow) => { const dateString = originalRow.activationDate; return dateString ? new Date(dateString) : new Date(0); }, id: 'activationDate', header: 'Activation Date', filterVariant: 'date-range', Cell: ({ cell }) => cell.getValue<Date>() ? cell.getValue<Date>().toLocaleString() : undefined, },
my activationDate maybe null sometimes and I tried fallbacking to undefined, null and empty string (which typescript doesn't permit) in accessorFn here, but filtering gets broken then.
It needs only supports date type so I could make it work only using epoch time but is there any other way to implement the logic here, if the provided date is null or undefined?
Beta Was this translation helpful? Give feedback.
All reactions