Replies: 1 comment
-
Closing |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Livewire PowerGrid version
v6.3.2
Livewire version
v3.6.3
Laravel version
v12.15.0
Which PHP version are you using?
PHP 8.3
Which Theme are you using?
Bootstrap 5
Have you published the resource files and customized them? (php artisan vendor:publish)
Yes
What is the problem?
When using a custom dateFormat like d/m/Y H:i in the locales config for a datetime filter, PowerGrid internally uses Carbon::parse() to parse the date string. This causes:
Carbon\Exceptions\InvalidFormatException: Could not parse '26/06/2025 00:00'
Because Carbon does not support parsing d/m/Y H:i by default unless explicitly told via createFromFormat().
📌 This occurs in:
vendor/power-components/livewire-powergrid/src/Concerns/Filter.php:142
Where this line appears:
📌 Relevance
This exact dateFormat is officially documented in your configuration examples under config/livewire-powergrid.php:
Code snippets
How do you expect it to work?
I expect PowerGrid to safely parse date strings that follow the format defined in the dateFormat config. Since the frontend is generating strings like 26/06/2025 00:00, PowerGrid should not assume a default Carbon format (Y-m-d H:i:s).
Instead, it should use Carbon::createFromFormat() with the correct format from the config.
Please confirm (incomplete submissions will not be addressed)
Beta Was this translation helpful? Give feedback.
All reactions