How to set $defaultDateDisplayFormat in service provider?

In vendor/filament/tables/src/Table.php there are a couple of static values which configure how the date of TextColumns is formatted by default. Can these formats be overwritten?
Solution:
As it's a static property I think Table::$defaultDateDisplayFormat = 'your-format'; should do it?
Jump to solution
2 Replies
Solution
Dennis Koch
Dennis Koch16mo ago
As it's a static property I think Table::$defaultDateDisplayFormat = 'your-format'; should do it?
Proculair B.V.
Proculair B.V.OP16mo ago
Thank you I ended up with this:
Table::configureUsing(function (Table $table): void {
Table::$defaultCurrency = 'eur';
Table::$defaultDateDisplayFormat = 'd F Y';
Table::$defaultDateTimeDisplayFormat = 'd F Y · H:i';
Table::$defaultTimeDisplayFormat = 'H:i';

$table
->paginationPageOptions([10, 25, 50])
->striped();
});
Table::configureUsing(function (Table $table): void {
Table::$defaultCurrency = 'eur';
Table::$defaultDateDisplayFormat = 'd F Y';
Table::$defaultDateTimeDisplayFormat = 'd F Y · H:i';
Table::$defaultTimeDisplayFormat = 'H:i';

$table
->paginationPageOptions([10, 25, 50])
->striped();
});
Want results from more Discord servers?
Add your server