Skip to content

treeStoneIT/nova-date-filter

 
 

Repository files navigation

Date Filter for Laravel Nova

Nova filter that displays a Date Picker instead of a select.

Demo

Demo

Install

Run this command in your nova project: composer require 64robots/nova-date-filter

How to use

Just use DateFilter class instead of Filter

use R64\Filters\DateFilter;

class DateFrom extends DateFilter
{
  //
}

Customization

As Date Filter is not a select anymore we can use options method to pass the date picker config

use R64\Filters\DateFilter;

class DateFrom extends DateFilter
{
  //...

  public function options(Request $request)
  {
    return [
      'dateFormat' => 'Y-m-d', // default Y-m-d H:i:S
      'placeholder' => 'My placeholder', // default __('Pick a date')
      'disabled' => true, // default false
      'twelveHourTime' => true, // default false
      'enableTime' => true, // default false
      'enableSeconds' => true, // default false
    ];
  }
}

About

A Laravel Nova date filter.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • CSS 78.7%
  • Vue 14.1%
  • PHP 5.7%
  • JavaScript 1.5%