-
Notifications
You must be signed in to change notification settings - Fork 879
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
[Bug] field date_range select ranges invalid date #5443
Comments
Hey @adriallongarriu The problem was the format. I created ranges with the following format: CRUD::field([
'name' => 'start_date,end_date',
'label' => 'Event Date Range',
'type' => 'date_range',
'date_range_options' => [
'ranges' => [
trans('backpack::crud.today') => [\Carbon\Carbon::now()->startOfDay()->format('m/d/Y'), \Carbon\Carbon::now()->startOfDay()->format('m/d/Y')],
trans('backpack::crud.yesterday') => [\Carbon\Carbon::now()->subDay()->startOfDay()->format('m/d/Y'), \Carbon\Carbon::now()->subDay()->endOfDay()->format('m/d/Y')],
]
]
]); |
Tested and it works but i don't undestend why. Why need this specified date format and why in the I checked https://www.daterangepicker.com/ and not specified a format. And is using I think the correct solution would be to implement the same change that exists in |
@pxpm could you take a look at this issue. I believe it's a bug and the correct solution will be implementing the same change as it is done in the I would have made a pull request but this file is in the pro |
Hey @adriallongarriu hope to find you well 🙏 Thanks for the ping, and sorry for the delay, we have been super busy adding Laravel 11 support to all our packages. I've released PRO 2.1.11 with the fix, let me know if you are still experiencing issues 🙏 Cheers |
Bug report
What I did
Use ranges options in a date_range. I wanted the same options as a filter an copy the seme config as
vendor\backpack\pro\resources\views\filters\date_range.blade.php
My code:
What I expected to happen
Be able to select a predefined date range
What happened
On clicking any range the date is invalid and it's impossible to select any date
What I've already tried to fix it
config('backpack.base.default_date_format')
is invalid for backpack v6. The key was changed to file ui.I override the date_range.blade.php and add the folowing code:
Is it a bug in the latest version of Backpack?
After I run
composer update backpack/crud
the bug... is it still there? YESBackpack, Laravel, PHP, DB version
When I run
php artisan backpack:version
the output is:The text was updated successfully, but these errors were encountered: