Skip to content
Discussion options

You must be logged in to vote

First of all you need to convert your date format to Excel with - \PhpOffice\PhpSpreadsheet\Shared\Date::dateTimeToExcel() function then you can use laravel column columnFormats() method.

code :

\PhpOffice\PhpSpreadsheet\Shared\Date::dateTimeToExcel(\Carbon\Carbon::parse($item->joining_date)) to convert date at table td column.

To conver date format at formView approach -
public function columnFormats(): array
{
return [
'A' => NumberFormat::FORMAT_DATE_DDMMYYYY,
];
}

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by nahidBdcom
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
Category
Q&A
Labels
None yet
3 participants