feat: add configurable date display formats [3.x]#129
Merged
ManukMinasyan merged 3 commits into3.xfrom Mar 30, 2026
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Adds global configuration hooks to control how date and datetime custom fields are displayed across the package’s Filament integrations, while aiming to preserve each component’s existing defaults when unset.
Changes:
- Introduces
CustomFields::useDateDisplayFormat()/useDateTimeDisplayFormat()plus getters to store global display format configuration. - Updates Filament form date/datetime pickers to use configured display formats.
- Updates Filament table column + infolist entry rendering to format date/datetime values using the configured formats.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| src/CustomFields.php | Adds static configuration storage + API for date/datetime display formats. |
| src/Filament/Integration/Components/Forms/DateComponent.php | Reads configured date display format for DatePicker display/placeholder. |
| src/Filament/Integration/Components/Forms/DateTimeComponent.php | Reads configured datetime display format for DateTimePicker display/placeholder. |
| src/Filament/Integration/Components/Tables/Columns/DateTimeColumn.php | Formats date/datetime table values using configured formats. |
| src/Filament/Integration/Components/Infolists/DateTimeEntry.php | Formats infolist date/datetime display using configured formats. |
src/Filament/Integration/Components/Infolists/DateTimeEntry.php
Outdated
Show resolved
Hide resolved
src/Filament/Integration/Components/Forms/DateTimeComponent.php
Outdated
Show resolved
Hide resolved
src/Filament/Integration/Components/Tables/Columns/DateTimeColumn.php
Outdated
Show resolved
Hide resolved
fcddc7d to
a585e2e
Compare
Allow applications to set global date/datetime display formats via CustomFieldsPlugin or CustomFields facade. All Filament components (forms, tables, infolists) and validation messages respect the configured format while preserving BC with null defaults.
a585e2e to
b335b11
Compare
- Use sample date as placeholder instead of raw PHP format string - Use ->date() for date-only fields in DateTimeEntry infolist - Accept nullable format in facade setters to allow resetting to defaults
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
CustomFieldsPlugin(Filament-idiomatic) andCustomFieldsfacadeUsage
Via Plugin (recommended)
Via Facade
Components Updated
CustomFieldsPluginboot()DateComponent(form)Y-m-ddateDisplayFormat()DateTimeComponent(form)Y-m-d H:i:sdateTimeDisplayFormat()DateTimeColumn(table)M j, Y/M j, Y H:iDateTimeEntry(infolist)Y-m-d/Y-m-d H:i:sDateConstraintRule(validation)M j, YdateDisplayFormat()Not changed (intentionally)
AbstractFormComponent::getFieldValue()-- storage format for hydration (Y-m-d), not displayImportColumnConfigurator-- storage format for parsing importsDateConstraintField-- management UI date picker storage formatTest plan