DataTable and Dates #10149
-
Is there a way to format a Date within the datatable and have it sort correctly as a Date? I can format it and have it display the way I need but it of course sorts a text not as a Date. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Hi @wtrudell360, custom sorting is supported through the |
Beta Was this translation helpful? Give feedback.
-
@tay1orjones , could you please explain how to use it for dates sorting? custom "sortRow" function receives the formatted value and it is not possible to get the raw values without parsing them. |
Beta Was this translation helpful? Give feedback.
Hi @wtrudell360, custom sorting is supported through the
sortRow
prop available onDataTable
. Through it you provide your own function to control sorting beyond the default text sort. Full info is available in theDataTable
Custom Sorting docs in storybook