Skip to content

Commit

Permalink
Don't filter out DateTime values
Browse files Browse the repository at this point in the history
  • Loading branch information
jschram committed Apr 19, 2024
1 parent ea00247 commit 4046d24
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Exportable.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace Rap2hpoutre\FastExcel;

use DateTimeInterface;
use Generator;
use Illuminate\Support\Collection;
use Illuminate\Support\Str;
Expand Down Expand Up @@ -280,7 +281,7 @@ private function transformRow($data)
return collect($data)->map(function ($value) {
return is_null($value) ? (string) $value : $value;
})->filter(function ($value) {
return is_string($value) || is_int($value) || is_float($value);
return is_string($value) || is_int($value) || is_float($value) || $value instanceof DateTimeInterface;
});
}

Expand Down

0 comments on commit 4046d24

Please sign in to comment.