Skip to content

Commit

Permalink
README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
keizah7 committed Sep 16, 2020
1 parent 7dd944c commit 819d8aa
Showing 1 changed file with 29 additions and 1 deletion.
30 changes: 29 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[![Latest Version on Packagist](https://img.shields.io/packagist/v/keizah7/custom-date-filter.svg)](https://packagist.org/packages/epartment/nova-dependency-container)
[![Latest Version on Packagist](https://img.shields.io/packagist/v/keizah7/custom-date-filter.svg)](https://packagist.org/packages/keizah7/custom-date-filter)
[![Total Downloads](https://img.shields.io/packagist/dt/keizah7/custom-date-filter.svg)](https://packagist.org/packages/epartment/nova-dependency-container)
![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)
![HitCount](http://hits.dwyl.io/keizah7/nova-date-filter.svg)
Expand Down Expand Up @@ -72,5 +72,33 @@ public function apply(Request $request, $query, $value)
return $query->where('created_at', Carbon::parse($value));
}
```
## Setup
Default filter setings is:
```
'altFormat' => 'Y-m-d H:i'
'dateFormat' => 'Y-m-d H:i'
'enableTime' => true
'enableSeconds' => false
'firstDayOfWeek' => 1
```
You can change them by modify your filter class `options` method:
```
/**
* Get the filter's available options.
*
* @param \Illuminate\Http\Request $request
* @return array
*/
public function options(Request $request)
{
return [
'altFormat' => 'Y-m-d H:i:S',
'dateFormat' => 'Y-m-d H:i:S',
'enableTime' => true,
'enableSeconds' => true,
'firstDayOfWeek' => 7,
];
}
```
## License
The MIT License (MIT). Please see [License File](https://github.com/keizah7/nova-date-filter/blob/master/LICENSE) for more information.

0 comments on commit 819d8aa

Please sign in to comment.