I have a table with date objects, which I transform for display like this:
{
key: "date",
formatter: (value, key, item) => {
return moment(value).format("L");
},
sortable: true
}
This breaks the sorting function because is a localized string. I'd like to do something like
sortingKey: value=>value
To override the string sorting of the rendered date and go back to sorting by dates, but I can't find anything like that.
Update: This is already sorted out, but to me the solution is not pretty. A prettier solution would have been:
field: {
key: 'date',
sorter: (value, item, fieldMeta) => {
// returns something that reacts to <
// key == fieldMeta.key
// default (current) implementation
return fieldMeta.formatter ? fieldMeta.formatter(value, fieldMeta.key, item) : value;
}