livewire-datatables icon indicating copy to clipboard operation
livewire-datatables copied to clipboard

sorting by date

Open goneill opened this issue 2 years ago • 1 comments

Hi there - I've never done this before so please bear with me! I'm LOVING this code for my datatable - the one issue i'm finding is that the date types have no sort-by option. If I convert the column to text then it shows a sort and it works, but I can't sort by date type column. I hope this is helpful and THANK YOU! (I program from time to time on the side and this is really very helpful!)

Grainne

goneill avatar Aug 17 '22 00:08 goneill

DateColumn it's a Extended Column so you must add ->sortable() method like this:

DateColumn::name('created_at')
->sortable()

insulae avatar Oct 21 '22 14:10 insulae