Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ADVAPP-1260]: Timestamps displayed for students and prospect records on the holistic profile are not optimized for display or converted to the time zones that are configured in the product #1364

Merged
merged 5 commits into from
Mar 13, 2025
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,10 @@ public function table(Table $table): Table
->icon(fn (CaseUpdateDirection $state): string => $state->getIcon())
->formatStateUsing(fn (CaseUpdateDirection $state): string => $state->getLabel()),
TextColumn::make('created_at')
->dateTime()
->sortable(),
TextColumn::make('updated_at')
->dateTime()
->sortable(),
])
->defaultSort('created_at', 'desc')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ public function table(Table $table): Table
}),
TextColumn::make('created_at')
->label('Date Created')
->dateTime()
->sortable(query: fn ($query, $direction) => $query->orderBy('engagement_files.created_at', $direction)),
TextColumn::make('createdBy.name')
->label('Created By')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ public function table(Table $table): Table
->sortable(),
TextColumn::make('created_at')
->label('Created')
->dateTime('g:ia - M j, Y')
->dateTime()
->toggleable()
->sortable(),
])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,10 @@ public function infolist(Infolist $infolist): Infolist
TextEntry::make('severity'),
TextEntry::make('suggested_intervention'),
TextEntry::make('status.name'),
TextEntry::make('createdBy.name')->label('Created By')->default('N/A'),
TextEntry::make('created_at')->label('Created Date'),
TextEntry::make('createdBy.name')->label('Created By')->placeholder('N/A'),
TextEntry::make('created_at')
->label('Created Date')
->dateTime(),
]);
}

Expand Down Expand Up @@ -147,6 +149,7 @@ public function table(Table $table): Table
TextColumn::make('status.name')
->sortable(),
TextColumn::make('created_at')
->dateTime()
->sortable(),
])
->filters([
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ public function table(Table $table): Table
->url(fn ($record) => UserResource::getUrl('view', ['record' => $record]))
->color('primary'),
TextColumn::make('pivot.created_at')
->dateTime()
->label('Subscribed At'),
])
->headerActions([
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,10 @@ public function infolist(Infolist $infolist): Infolist
TextEntry::make('severity'),
TextEntry::make('suggested_intervention'),
TextEntry::make('status.name'),
TextEntry::make('createdBy.name')->label('Created By')->default('N/A'),
TextEntry::make('created_at')->label('Created Date'),
TextEntry::make('createdBy.name')->label('Created By')->placeholder('N/A'),
TextEntry::make('created_at')
->label('Created Date')
->dateTime(),
]);
}

Expand Down Expand Up @@ -119,6 +121,7 @@ public function table(Table $table): Table
->sortable(),
TextColumn::make('created_at')
->sortable()
->dateTime()
->toggleable(
isToggledHiddenByDefault: true,
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ public function table(Table $table): Table
->url(fn ($record) => UserResource::getUrl('view', ['record' => $record]))
->color('primary'),
TextColumn::make('pivot.created_at')
->dateTime()
->label('Subscribed At'),
])
->headerActions([
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ public function table(Table $table): Table
->badge(),
TextColumn::make('due')
->label('Due Date')
->dateTime()
->sortable(),
TextColumn::make('assignedTo.name')
->label('Assigned To')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ public function table(Table $table): Table
->orderBy('application_submission_states.name', $direction);
}),
TextColumn::make('created_at')
->dateTime()
->sortable(),
])
->actions([
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ public function infolist(Infolist $infolist): Infolist
TextEntry::make('type')
->getStateUsing(fn (EmailMessageEvent|SmsMessageEvent $record): string => $record->type?->getLabel()),
TextEntry::make('occured_at')
->dateTime()
->getStateUsing(fn (EmailMessageEvent|SmsMessageEvent $record): string => $record->occurred_at->format('Y-m-d H:i:s')),
])
->columns(),
Expand All @@ -131,8 +132,8 @@ public function infolist(Infolist $infolist): Infolist
]),
Section::make([
TextEntry::make('sent_at')
->getStateUsing(fn (Timeline $record): string => $record->timelineable->sent_at)
->dateTime('Y-m-d H:i:s'),
->dateTime()
->getStateUsing(fn (Timeline $record): string => $record->timelineable->sent_at),
])->grow(false),
])
->from('md')
Expand Down Expand Up @@ -173,6 +174,7 @@ public function table(Table $table): Table
}),
TextColumn::make('record_sortable_date')
->label('Date')
->dateTime()
->sortable(),
])
->headerActions([
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,31 +81,33 @@ public function infolist(Infolist $infolist): Infolist
->label('Earned'),
TextEntry::make('section')
->label('Section')
->default('N/A'),
->placeholder('N/A'),
TextEntry::make('name')
->label('Name')
->default('N/A'),
->placeholder('N/A'),
TextEntry::make('department')
->label('Department')
->default('N/A'),
->placeholder('N/A'),
TextEntry::make('faculty_name')
->label('Faculty Name')
->default('N/A'),
->placeholder('N/A'),
TextEntry::make('faculty_email')
->label('Faculty Email')
->default('N/A'),
->placeholder('N/A'),
TextEntry::make('semester_code')
->label('Semester Code')
->default('N/A'),
->placeholder('N/A'),
TextEntry::make('semester_name')
->label('Semester Name')
->default('N/A'),
->placeholder('N/A'),
TextEntry::make('start_date')
->label('Start Date')
->default('N/A'),
->dateTime()
->placeholder('N/A'),
TextEntry::make('end_date')
->label('End Date')
->default('N/A'),
->dateTime()
->placeholder('N/A'),
]
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,18 +124,22 @@ public function infolist(Infolist $infolist): Infolist
->visible($sisSystem?->hasProgramsCumGpa() ?? true),
TextEntry::make('declare_dt')
->label('Start Date')
->dateTime()
->placeholder('-')
->visible($sisSystem?->hasProgramsDeclareDt() ?? true),
TextEntry::make('change_dt')
->label('Last Action Date')
->dateTime()
->placeholder('-')
->visible($sisSystem?->hasProgramsChangeDt() ?? true),
TextEntry::make('graduation_dt')
->label('Graduation Date')
->dateTime()
->placeholder('-')
->visible($sisSystem?->hasProgramsGraduationDt() ?? true),
TextEntry::make('conferred_dt')
->label('Conferred Date')
->dateTime()
->placeholder('-')
->visible($sisSystem?->hasProgramsConferredDt() ?? true),
]);
Expand All @@ -162,9 +166,11 @@ public function table(Table $table): Table
->visible($sisSystem?->hasProgramsCumGpa() ?? true),
TextColumn::make('declare_dt')
->label('Start Date')
->dateTime()
->visible($sisSystem?->hasProgramsDeclareDt() ?? true),
TextColumn::make('graduation_dt')
->label('Graduation Date')
->dateTime()
->visible($sisSystem?->hasProgramsGraduationDt() ?? true),
])
->actions([
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,11 @@ public function taskInfoList(): array
->badge(),
TextEntry::make('due')
->label('Due Date')
->default('N/A'),
->dateTime()
->placeholder('N/A'),
TextEntry::make('createdBy.name')
->label('Created By')
->default('N/A')
->placeholder('N/A')
->url(fn (Task $record) => $record->createdBy ? UserResource::getUrl('view', ['record' => $record->createdBy]) : null),
]),
])->from('md'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ public function table(Table $table): Table
->badge(),
TextColumn::make('due')
->label('Due Date')
->dateTime()
->sortable(),
TextColumn::make('assignedTo.name')
->label('Assigned To')
Expand Down
17 changes: 11 additions & 6 deletions app/Providers/FilamentServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,12 @@
use Filament\Forms\Components\DateTimePicker;
use Filament\Forms\Components\Toggle;
use Filament\Infolists\Components\TextEntry;
use Filament\Infolists\Infolist;
use Filament\Support\Colors\Color;
use Filament\Support\Facades\FilamentColor;
use Filament\Support\Facades\FilamentView;
use Filament\Tables\Columns\TextColumn;
use Filament\Tables\Table;
use Illuminate\Support\ServiceProvider;
use Illuminate\View\View;
use Ysfkaya\FilamentPhoneInput\Forms\PhoneInput;
Expand Down Expand Up @@ -184,6 +186,9 @@ public function boot(): void
],
]);

Table::$defaultDateTimeDisplayFormat = 'M j, Y g:ia';
Infolist::$defaultDateTimeDisplayFormat = 'M j, Y g:ia';

FilamentView::registerRenderHook(
'panels::footer',
fn (): View => view('filament.footer'),
Expand Down Expand Up @@ -215,8 +220,8 @@ public function boot(): void

return null;
})
->tooltip(function (TextColumn $column) use ($timezoneLabel): ?string {
if ($column->isDateTime()) {
->tooltip(function (TextColumn $column, $state) use ($timezoneLabel): ?string {
if ($column->isDateTime() && ! blank($state)) {
return "This time is set in {$timezoneLabel}.";
}

Expand All @@ -236,15 +241,15 @@ public function boot(): void

return null;
})
->hintIcon(function (TextEntry $entry): ?string {
if ($entry->isDateTime()) {
->hintIcon(function (TextEntry $entry, $state): ?string {
if ($entry->isDateTime() && ! blank($state)) {
return 'heroicon-m-clock';
}

return null;
})
->hintIconTooltip(function (TextEntry $entry) use ($timezoneLabel): ?string {
if ($entry->isDateTime()) {
->hintIconTooltip(function (TextEntry $entry, $state) use ($timezoneLabel): ?string {
if ($entry->isDateTime() && ! blank($state)) {
return "This time is set in {$timezoneLabel}.";
}

Expand Down