Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

EdsonOrdaz's avatar

Excel filter does not work in date format

Hi, I am using Laravel Excel to export data, specifically I have the column 'J' and 'K' with date format, for the date I am using the following format in the export:

    public function columnFormats(): array{
        return [
            'J' => NumberFormat::FORMAT_DATE_DDMMYYYY,
            'K' => NumberFormat::FORMAT_DATE_DDMMYYYY,
        ];
    }

I do the export through a view and the code is as follows:

<td style="text-align: center;"> {{ \Carbon\Carbon::parse( $factura->FECHAEMISION )->format('d/m/Y'); }} </td>
<td style="text-align: center;"> {{ \Carbon\Carbon::parse( $factura->VENCIMIENTO )->format('d/m/Y'); }} </td>

he problem is in Excel, when I open the filter it appears as follows: Image 1

and the way I need the filtering is this:

Image 2

0 likes
0 replies

Please or to participate in this conversation.