Support the ongoing development of Laravel.io →
posted 1 week ago
Nova
0

Not familiar with nova myself, but yes format was removed in v4 Nova - Date Time Fields

Using a formatted Text field appears to be the easiest workaround. Personally I'd avoid making this change unless absolutely necessary.

0

But when it is

absolutely necessary

, which code/methods do you use ?

Last updated by @sergeynilov 1 week ago.
0

I define Date field as :

                    Date::make(__('Published at'), 'published_at')
                        ->displayUsing(fn($value) => $value ? DateConv::getFormattedDateTime($value) : '--')
                        ->sortable(),

where DateConv::getFormattedDateTime apply format j F, Y g:i A and label in index/view pages looks like 3 July, 2024 11:21 AM

but in details editor 07/23/2024 that is very inconvinient. In my country more used format is 'yyyy-mm-dd'. If there is a way to apply this format ?

0

Sign in to participate in this thread!

Eventy

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.