F
Filament2mo ago
keiron

Set default dateTime() table display format

I was under the impression this is now possible in v4, but am struggling to find documentation about it.
Solution:
The code I was looking for is: Table::configureUsing(function (Table $table): void { $table->defaultDateTimeDisplayFormat('j M Y, H:i:s'); $table->defaultDateDisplayFormat('j M Y'); });...
Jump to solution
5 Replies
keiron
keironOP2mo ago
Hmm if I applied ->dateTime(Y) here it would apply to all columns. Specifically I’m looking for some functionality to change the default ->dateTime() format. There used to be the defaultDateTimeDisplayFormat setting apparently.
LeandroFerreira
LeandroFerreira2mo ago
all columns? Could you explain what you are trying to do and the code that you are using?
Solution
keiron
keiron2mo ago
The code I was looking for is: Table::configureUsing(function (Table $table): void { $table->defaultDateTimeDisplayFormat('j M Y, H:i:s'); $table->defaultDateDisplayFormat('j M Y'); });
keiron
keironOP2mo ago
A quick search of defaultDateTimeDisplayFormat shows no results in the docs. I would suggest it gets added, probably at the link you supplied. Thanks.

Did you find this page helpful?