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

DateRangeFilter showing current date as placeholder causes confusion #74

Open
BenOussama180 opened this issue May 28, 2023 · 5 comments

Comments

@BenOussama180
Copy link

DateRangeFilter::make('Requested at', 'order_date')
                ->config([
                    'ariaDateFormat' => 'F j, Y',
                    'dateFormat' => 'Y-m-d',
                ])->filter(function (Builder $builder, array $date_range) {
                    $builder->whereDate('orders.created_at', '>=', $date_range['minDate'])
                        ->whereDate('orders.created_at', '<=', $date_range['maxDate']);
                }),

image
how can i fx this ? @lrljoe

@lrljoe
Copy link
Member

lrljoe commented May 28, 2023

Not at my desk right now, but if I remember correctly there's an option() for setting the default dates

@lrljoe
Copy link
Member

lrljoe commented May 28, 2023

If not, then I'll do a patch, probably tomorrow, I've been quite busy lately with the main Rappasoft package, but I'll get this sorted for you.

Some of these filters will be making their way into v3 of the core package, along with a host of other improvements.

@lrljoe
Copy link
Member

lrljoe commented May 29, 2023

I've done a quick patch, if you fancy testing it out for me then just use the develop branch, the only difference should be that develop doesn't set today as default for date ranges

If you say it works, then I'll add a new release in.

It's passing tests, and it seemed to work when I gave it a quick poke, but testing across both packages is something I'll be looking at later this year with v3.

Let me know if the develop branch works or if I've broken it horribly 😂

@BenOussama180
Copy link
Author

i will test it in a dummy project this afternoon i will let you know!

@lrljoe
Copy link
Member

lrljoe commented Aug 26, 2023

This is fixed in the Rappasoft v3 beta, as DateRangeFilter is a core feature as of v3. I'll be backporting some fixes into v2 once v3 is stable and released. If you're going to Livewire 3, then definitely check out the core Rappasoft V3 beta.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants