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:Jump to 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');
});
...5 Replies
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.
all columns? Could you explain what you are trying to do and the code that you are using?
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');
});
A quick search of defaultDateTimeDisplayFormat shows no results in the docs. I would suggest it gets added, probably at the link you supplied. Thanks.