Skip to content

can't seem to find a way to make formatted date sortable #316

Answered by snapey
snapey asked this question in Q&A
Discussion options

You must be logged in to vote

After source diving I found the solution

            Column::add()
                ->title(__('CREATED AT'))
                ->field('created_at_formatted','created_at')
                ->sortable(),

by specifying the 'source' data in the second parameter of the field() function

This could be clearer in the docs

Also think its odd that its not possible to overwrite the format of the column without giving it a new name

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@snapey
Comment options

@luanfreitasdev
Comment options

Answer selected by snapey
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants