Skip to content

Commit

Permalink
Fix closes_after value
Browse files Browse the repository at this point in the history
  • Loading branch information
Tschucki committed Mar 11, 2024
1 parent 1ce74a7 commit 1b2756c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/Filament/Resources/PublicPollsResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

use App\Filament\Resources\PublicPollsResource\Pages;
use App\Models\Polls\PublicPoll;
use Carbon\Carbon;
use Filament\Forms\Form;
use Filament\Resources\Pages\Page;
use Filament\Resources\Resource;
Expand Down Expand Up @@ -45,7 +46,7 @@ public static function table(Table $table): Table
Tables\Columns\TextColumn::make('title')->weight(FontWeight::ExtraBold)->label('Titel')->prefix('Titel: ')->searchable()->sortable(),
Tables\Columns\TextColumn::make('description')->label('Beschreibung')->searchable()->sortable(),
Tables\Columns\TextColumn::make('category.title')->prefix('Kategorie: ')->label('Kategorie')->searchable()->sortable(),
Tables\Columns\TextColumn::make('closes_after')->label('Ende')->prefix('Endet in: ')->state(fn (PublicPoll $publicPoll) => $publicPoll->hasEnded() ? 'Geschlossen' : now()->add($publicPoll->closes_after)->diffForHumans().' ('.$publicPoll->closes_at->format('d.m.Y H:i').' Uhr)')->toggleable(),
Tables\Columns\TextColumn::make('closes_after')->label('Ende')->prefix('Endet in: ')->state(fn (PublicPoll $publicPoll) => $publicPoll->hasEnded() ? 'Geschlossen' : Carbon::make($publicPoll->published_at)?->add($publicPoll->closes_after)->diffForHumans().' ('.$publicPoll->closes_at->format('d.m.Y H:i').' Uhr)')->toggleable(),
Tables\Columns\TextColumn::make('user.name')->label('Ersteller')->prefix('Von: ')->state(fn (PublicPoll $publicPoll) => $publicPoll->not_anonymous ? $publicPoll->user->name : '')->searchable()->sortable(),
Tables\Columns\TextColumn::make('within_target_group')->label('Innerhalb deiner Zielgruppe')->icon(function (PublicPoll $poll) {
return $poll->userIsWithinTargetGroup(\Auth::user()) ? 'heroicon-o-check-circle' : 'heroicon-o-x-circle';
Expand Down

0 comments on commit 1b2756c

Please sign in to comment.