Skip to content

Commit

Permalink
get the default format from Infolist::$defaultDateDisplayFormat
Browse files Browse the repository at this point in the history
  • Loading branch information
atmonshi committed Feb 6, 2024
1 parent c24000c commit 9c811ce
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 14 deletions.
4 changes: 2 additions & 2 deletions resources/views/errors/date-not-available.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@

<x-slot name="actions">
<span class="text-sm text-gray-500">{{ __('Start date') }}</span>:
<span class="text-sm">{{ $zeusForm->start_date->format(\Filament\Tables\Table::$defaultDateTimeDisplayFormat) }}</span>,
<span class="text-sm">{{ $zeusForm->start_date->format(\Filament\Infolists\Infolist::$defaultDateTimeDisplayFormat) }}</span>,
<span class="text-sm text-gray-500">{{ __('End date') }}</span>:
<span class="text-sm">{{ $zeusForm->end_date->format(\Filament\Tables\Table::$defaultDateTimeDisplayFormat) }}</span>
<span class="text-sm">{{ $zeusForm->end_date->format(\Filament\Infolists\Infolist::$defaultDateTimeDisplayFormat) }}</span>
</x-slot>
</x-filament::section>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class="rounded-full"
@endif
<p class="flex flex-col my-1 gap-1">
<span class="text-base font-light">{{ __('created at') }}:</span>
<span class="font-semibold">{{ $getRecord->created_at->format('Y.m/d') }}-{{ $getRecord->created_at->format('h:i a') }}</span>
<span class="font-semibold">{{ $getRecord->created_at->format(\Filament\Infolists\Infolist::$defaultDateDisplayFormat) }}-{{ $getRecord->created_at->format(\Filament\Infolists\Infolist::$defaultTimeDisplayFormat) }}</span>
</p>
</x-filament::section>
<x-filament::section>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class="rounded-full"
@endif
<p class="flex flex-col my-1 gap-1">
<span class="text-base font-light">{{ __('created at') }}:</span>
<span class="font-semibold">{{ $response->created_at->format('Y.m/d') }}-{{ $response->created_at->format('h:i a') }}</span>
<span class="font-semibold">{{ $response->created_at->format(\Filament\Infolists\Infolist::$defaultDateDisplayFormat) }}-{{ $response->created_at->format(\Filament\Infolists\Infolist::$defaultTimeDisplayFormat) }}</span>
</p>
</x-filament::section>
<x-filament::section>
Expand Down
23 changes: 15 additions & 8 deletions resources/views/themes/zeus/bolt/fill-forms.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,26 @@
<div class="text-gray-400 text-sm">
@svg('heroicon-o-calendar','h-4 w-4 inline-flex')
<span>{{ __('Available from') }}:</span>
<span>{{ optional($zeusForm->start_date)->format('Y/m/d') }}</span>,
<span>{{ optional($zeusForm->start_date)->format(\Filament\Infolists\Infolist::$defaultDateDisplayFormat) }}</span>,
<span>{{ __('to') }}:</span>
<span>{{ optional($zeusForm->end_date)->format('Y/m/d') }}</span>
<span>{{ optional($zeusForm->end_date)->format(\Filament\Infolists\Infolist::$defaultDateDisplayFormat) }}</span>
</div>
@endif
</x-slot>
@endif

<x-slot name="breadcrumbs">
<li class="flex items-center">
<a href="{{ route('bolt.forms.list') }}">{{ __('Forms') }}</a>
@svg('iconpark-rightsmall-o','fill-current w-4 h-4 mx-3 rtl:rotate-180')
</li>
@if($zeusForm->extensions === null)
<li class="flex items-center">
<a href="{{ route('bolt.forms.list') }}">{{ __('Forms') }}</a>
@svg('iconpark-rightsmall-o','fill-current w-4 h-4 mx-3 rtl:rotate-180')
</li>
@else
<li class="flex items-center">
<a href="{{ \LaraZeus\Bolt\Facades\Extensions::init($zeusForm, 'route') }}">{{ \LaraZeus\Bolt\Facades\Extensions::init($zeusForm, 'label') }}</a>
@svg('iconpark-rightsmall-o','fill-current w-4 h-4 mx-3 rtl:rotate-180')
</li>
@endif
<li class="flex items-center">
{{ $zeusForm->name }}
</li>
Expand Down Expand Up @@ -63,9 +70,9 @@ class="bg-white rounded-full shadow-md shadow-custom-100 sm:w-24 object-cover"
@svg('heroicon-o-calendar','h-5 w-5 inline-flex')
<span class="flex items-center justify-center gap-1">
<span>{{ __('Available from') }}:</span>
<span>{{ optional($zeusForm->start_date)->format('Y/m/d') }}</span>,
<span>{{ optional($zeusForm->start_date)->format(\Filament\Infolists\Infolist::$defaultDateDisplayFormat) }}</span>,
<span>{{ __('to') }}:</span>
<span>{{ optional($zeusForm->end_date)->format('Y/m/d') }}</span>
<span>{{ optional($zeusForm->end_date)->format(\Filament\Infolists\Infolist::$defaultDateDisplayFormat) }}</span>
</span>
</div>
@endif
Expand Down
2 changes: 1 addition & 1 deletion resources/views/themes/zeus/bolt/show-entry.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
</p>
<p class="flex flex-col">
<span class="text-base font-light">{{ __('created at') }}:</span>
<span class="font-semibold">{{ $response->created_at->format('Y.m/d') }}-{{ $response->created_at->format('h:i a') }}</span>
<span class="font-semibold">{{ $response->created_at->format(\Filament\Infolists\Infolist::$defaultDateDisplayFormat) }}-{{ $response->created_at->format(\Filament\Infolists\Infolist::$defaultTimeDisplayFormat) }}</span>
</p>
</x-filament::section>
<div>
Expand Down
2 changes: 1 addition & 1 deletion src/Concerns/HasUpdates.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ trait HasUpdates
{
public function getLastUpdatedAttribute(): string
{
return '<span class="text-xs text-gray-600">' . Carbon::parse($this->updated_at)->format(config('zeus.defaultDateFormat')) . '</span>';
return '<span class="text-xs text-gray-600">' . Carbon::parse($this->updated_at)->format(\Filament\Infolists\Infolist::$defaultDateTimeDisplayFormat) . '</span>';
}
}
4 changes: 4 additions & 0 deletions src/Contracts/Extension.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ interface Extension
{
public function label(): string;

// the home page for your ext to use in the frontend,
// for example with thunder it is: route('thunder.offices.list')
public function route(): string;

/**
* before displaying the form, do some checks
* for example check if the $data['extensionSlug'] param is existed, or the user is logged in !
Expand Down

0 comments on commit 9c811ce

Please sign in to comment.