Skip to content

SearchLogic with localised dates #1175

Closed Answered by jcastroa87
diereysaa asked this question in Q&A (Help)
Discussion options

You must be logged in to vote

Hello @diereysaa

If you are using MySQL, did you try with "DATE_FORMAT"

CRUD::column('start_date')
    ->label('Inicio del curso')
    ->type('date')
    ->searchLogic(function ($query, $column, $searchTerm) {
        $query->orWhereRaw("DATE_FORMAT(start_date, '%d %b %Y') LIKE ?", ['%' . $searchTerm . '%']);
    });

Cheers.

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by diereysaa
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants