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

Enables time picker for date_range filter #547

Merged
merged 1 commit into from
Jan 31, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions 6.x/crud-filters.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,13 +128,13 @@ CRUD::filter('name')->remove();
- ```->forget('attribute_name')``` - By chaining **forget('attribute_name')** to a filter you remove that attribute from the filter;

```php
CRUD::filter('price')->prefix('$'); // will have "$" as prefix
CRUD::filter('price')->prefix('$'); // will have "$" as prefix
CRUD::filter('price')->forget('prefix'); // will no longer have "$" as prefix

// Note:
// You can only call "forget" on filter attributes. Calling "forget" on "before",
// "after", "whenActive", "whenInactive" etc. will do nothing, because those
// are not attributes, they are methods. You can, however, forget filter logic
// Note:
// You can only call "forget" on filter attributes. Calling "forget" on "before",
// "after", "whenActive", "whenInactive" etc. will do nothing, because those
// are not attributes, they are methods. You can, however, forget filter logic
// or fallback logic by using their attributes:
CRUD::filter('price')->forget('logic');
CRUD::filter('price')->forget('fallbackLogic');
Expand Down Expand Up @@ -250,6 +250,10 @@ Show a daterange picker. The user can select a start date and an end date.
```php
CRUD::filter('from_to')
->type('date_range')
// set options to customize, www.daterangepicker.com/#options
->date_range_options([
'timePicker' => true // example: enable/disable time picker
])
->whenActive(function($value) {
// $dates = json_decode($value);
// CRUD::addClause('where', 'date', '>=', $dates->from);
Expand Down
Loading