The Popular Datetime, Flatpickr Picker as a Filament Form Field

Overview

Flatpickr Date/Time Picker as a Filament Field

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

Flatpickr is one of the most popular js datepickers. This filament plugin allows you to use flatpickr as a Filament Field without the sweat of configuration.

image image

Features

  • Configure easily using fluent (chained) methods
  • Supports an optional month Selector
  • Supports an optional week selector
  • Support for both light and dark modes
  • Specify the theme (among the available themes) as a configuration
  • Supports Range Selection mode
  • Supports multiple date selection mode
  • And many more features are coming...

Installation

You can install the package via composer:

composer require savannabits/filament-flatpickr

You can publish the config file with:

php artisan vendor:publish --tag="filament-flatpickr-config"

This is the contents of the published config file:

return [
    'default_theme' => 'airbnb', // 'default','dark','material_blue','material_green','material_red','material_orange','airbnb','confetti'
];

If you are using a custom filament theme (using tailwind.config.js), append the following to tailwind.config.js under content for proper styling:

module.exports = {
    content: [
        ...,
        './vendor/savannabits/filament-flatpickr/**/*.blade.php', // <== Add this line
    ],

Usage

Use the Flatpickr field anywhere in your filament forms as shown in the following examples

use Savannabits\Flatpickr\Flatpickr;

// Basic, Date Field
Flatpickr::make('read_at')->default(now()),

image

// Datetime field
Flatpickr::make('read_at')->enableTime(),

image

// Month Selector field
Flatpickr::make('read_at')->monthSelect(),

image

// Date Range picker field
Flatpickr::make('read_at')->rangePicker(),

image

// Specify the Date format
Flatpickr::make('read_at')->dateFormat('Y-m-d'),

// Toggle AltInput (true by default) and set Alt Display Format:
Flatpickr::make('read_at')->altInput(true)->altFormat('F J Y'),

image

// Specify the input Date Format
Flatpickr::make('read_at')->dateFormat('d/m/Y')->altInput(false),

image

// Specify the Datepicker's Theme: See for https://flatpickr.js.org/themes/ available themes
Flatpickr::make('read_at')->theme('material_red'),

image

Automatic dark mode:

image

Testing

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.

Comments
  • Bump dependabot/fetch-metadata from 1.3.4 to 1.3.5

    Bump dependabot/fetch-metadata from 1.3.4 to 1.3.5

    Bumps dependabot/fetch-metadata from 1.3.4 to 1.3.5.

    Release notes

    Sourced from dependabot/fetch-metadata's releases.

    v1.3.5

    What's Changed

    New Contributors

    Full Changelog: https://github.com/dependabot/fetch-metadata/compare/v1...v1.3.5

    Commits
    • 5ef0018 Merge pull request #282 from dependabot/v1.3.5-release-notes
    • a9380d2 v1.3.5
    • 404ba25 Merge pull request #280 from dependabot/drop-readme-from-bump-script
    • f40d4c7 Don't bump pin versions in README.md
    • 7db64c3 Merge pull request #252 from dependabot/document-release-steps
    • daa85e7 Add mention of npm run build if dev deps need updating.
    • b768c40 Document steps for cutting a new release
    • 9833f74 Merge pull request #273 from dependabot/dependabot/npm_and_yarn/yargs-and-typ...
    • 32b7ed3 Bump yargs and @​types/yargs
    • 7942397 Merge pull request #271 from dependabot/dependabot/npm_and_yarn/actions/githu...
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    opened by dependabot[bot] 1
  • Bump dependabot/fetch-metadata from 1.3.3 to 1.3.4

    Bump dependabot/fetch-metadata from 1.3.3 to 1.3.4

    Bumps dependabot/fetch-metadata from 1.3.3 to 1.3.4.

    Release notes

    Sourced from dependabot/fetch-metadata's releases.

    v1.3.4

    What's Changed

    New Contributors

    Full Changelog: https://github.com/dependabot/fetch-metadata/compare/v1.3.3...v1.3.4

    Commits
    • bfc19f4 v1.3.4
    • 4367f58 Merge pull request #258 from dependabot/dependabot/npm_and_yarn/yaml-2.1.1
    • 00ab600 Manually bump dist/
    • bdbe81d Bump yaml from 2.0.1 to 2.1.1
    • 5fc325a Merge pull request #257 from dependabot/dependabot/npm_and_yarn/typescript-4.8.3
    • c91309c Bump typescript from 4.6.3 to 4.8.3
    • 264d039 Merge pull request #266 from dependabot/dependabot/npm_and_yarn/ts-node-10.9.1
    • d1cd6ed Bump ts-node from 10.7.0 to 10.9.1
    • e3cb77e Merge pull request #265 from dependabot/dependabot/npm_and_yarn/actions/githu...
    • e462341 [dependabot skip] Update dist/ with build changes
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    opened by dependabot[bot] 1
  • Bug: Datepicker not loading in Action Modals - datepicker is undefined

    Bug: Datepicker not loading in Action Modals - datepicker is undefined

    When loading the datepicker inside an action modal, it does not load and the js console throws an error because it cannot find the datepicker js function.

    bug 
    opened by coolsam726 0
  • Range picker doesn't seem to work.

    Range picker doesn't seem to work.

    A Carbon\Exceptions\InvalidFormatException is thrown when submitting a range picker. This seems to happen because dehydrateStateUsing() tries to parse the state with Carbon. Since the state contains 2 dates the parsing fails.

    The same happens when using default(), but this time afterStateHydrated() fails with the same error.

    opened by 0liverdam 0
  • Alt Format Not Changing

    Alt Format Not Changing

    Hi,

    I noticed that the alt format wasn't being changed, so I tinkered a bit and explored that we needed to tweak a couple of lines of code.

    In file: flatpickr.blade.php please add: "altInput" => $isAltInput(), after line 3.

    In file dist/datepicker.js please change line 16 to "altFormat: attribs.altFormat,"

    That should do it. Thanks for making this component I really appreciate it!

    opened by vitorpena 1
  • Bump ramsey/composer-install from 1 to 2

    Bump ramsey/composer-install from 1 to 2

    Bumps ramsey/composer-install from 1 to 2.

    Release notes

    Sourced from ramsey/composer-install's releases.

    2.0.0

    Added

    • Use --prefer-stable with lowest dependencies (#178)
    • Allow use of a custom cache key (#167)
    • Allow ability to ignore the cache

    Changed

    Fixed

    • Fix case where working-directory did not run composer install in the correct working directory (#187)
    • Fix problems with retrieving cache with parallel builds (#161, #152)
    • Fix problems restoring from cache on Windows (#79)

    1.3.0

    • Support passing --working-dir as part of composer-options

    1.2.0

    • Support Composer working-directory option for when composer.json is in a non-standard location.
    • Add operating system name to the cache key.

    1.1.0

    Display Composer output with ANSI colors.

    1.0.3

    Patch release for dependency updates.

    1.0.2

    • Use the GitHub cache action directly to avoid duplication of code/effort.
    • Turn on output of Composer command to provide feedback in the job log
    • Use Composer cache-dir instead of cache-files-dir

    1.0.1

    Rewrite and refactor as a JavaScript action.

    Commits
    • 83af392 :sparkles: Add new custom-cache-suffix option (#239)
    • 7f9021e Fix use of deprecated set-output command (#238)
    • 4617231 Tests: update the included composer.phar from v 2.2.2 to 2.2.18 (#237)
    • 72896eb Add dependabot configuration file (#227)
    • 69e970d GH Actions: version update for codecov action runner (#226)
    • e3612f6 GH Actions: version update for actions/cache (#224)
    • d515102 GH Actions: version update for various predefined actions (#222)
    • 6085843 GH Actions: re-work the integration tests (#221)
    • f680dac test: add PHP path back to command, as well as debug message
    • 3c51967 test: ensure we use the alternate composer location
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    opened by dependabot[bot] 1
  • Not working in action modal

    Not working in action modal

    When using the field in an action modal I get

    Alpine Expression Error: mode is not defined
    
    Expression: "mode ==='dark'"
    
    <template x-if="mode ==='dark'">
    
    opened by martin-ro 6
  • Bump actions/configure-pages from 1 to 2

    Bump actions/configure-pages from 1 to 2

    Bumps actions/configure-pages from 1 to 2.

    Release notes

    Sourced from actions/configure-pages's releases.

    v2.0.0

    Changelog

    🚀 Features

    • [BREAKING] Remove the trailing slash from base_url and base_path outputs @​JamesMGreene (#19)

    See details of all code changes since previous release.

    v1.2.1

    Changelog

    See details of all code changes since previous release.

    v1.2.0

    Changelog

    See details of all code changes since previous release.

    v1.1.0

    Changelog

    See details of all code changes since previous release.

    Commits
    • 61fd3a3 Merge pull request #19 from actions/no-trailing-slashes
    • 0ec542a Update distributables
    • 3a90973 Use local module for removing trailing slash to reduce duplication
    • dc5b850 breaking: Remove trailing slash from base_url and base_path outputs
    • See full diff in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    opened by dependabot[bot] 1
  • Bump aglipanci/laravel-pint-action from 0.1.0 to 1.0.0

    Bump aglipanci/laravel-pint-action from 0.1.0 to 1.0.0

    Bumps aglipanci/laravel-pint-action from 0.1.0 to 1.0.0.

    Release notes

    Sourced from aglipanci/laravel-pint-action's releases.

    v1.0.0

    • Stable release
    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    opened by dependabot[bot] 1
Releases(v1.0.3)
  • v1.0.3(Aug 25, 2022)

    What's Changed

    • Update flatpickr.blade.php by @coolsam726 in https://github.com/savannabits/filament-flatpickr/pull/5

    Full Changelog: https://github.com/savannabits/filament-flatpickr/compare/v1.0.2...v1.0.3

    Source code(tar.gz)
    Source code(zip)
  • v1.0.2(Aug 11, 2022)

    What's Changed

    • Bug Fix: Datepicker not loading in action modals by @coolsam726 in https://github.com/savannabits/filament-flatpickr/pull/2

    New Contributors

    • @coolsam726 made their first contribution in https://github.com/savannabits/filament-flatpickr/pull/2

    Full Changelog: https://github.com/savannabits/filament-flatpickr/compare/v1.0.1...v1.0.2

    Source code(tar.gz)
    Source code(zip)
  • v1.0.1(Aug 8, 2022)

  • v1.0.0(Aug 8, 2022)

    v1.0.0 First Release. Features:

    • Configure easily using fluent (chained) methods
    • Supports an optional month Selector
    • Supports an optional week selector
    • Support for both light and dark modes
    • Specify the theme (among the available themes) as a configuration
    • Supports Range Selection mode
    • Supports multiple date selection mode
    • And many more features are coming...

    Full Changelog: https://github.com/savannabits/filament-flatpickr/commits/v1.0.0

    Source code(tar.gz)
    Source code(zip)
Owner
Savannabits
Coding is much more fun when it's shared!
Savannabits
A media picker plugin for Filament Admin.

Filament Curator A media picker plugin for Filament Admin. ‼️ This package is still in development ‼️ This package does not work with Spatie Media Lib

Adam Weston 84 Jan 7, 2023
The Most Popular JavaScript Calendar as a Filament Widget 💛

The Most Popular JavaScript Calendar as a Filament Widget ?? Features Accepts all configurations from FullCalendar Event click and drop events Upcomin

Guilherme Saade 62 Dec 31, 2022
A single-field repeater for Filament. ⚡️

A single-field repeater for Filament. This is where your description should go. Limit it to a paragraph or two. Consider adding a small example. Insta

Ryan Chandler 3 Mar 5, 2022
Provides the missing range field for the Filament forms.

The missing range field for the Filament forms. Installation You can install the package via composer: composer require yepsua/filament-range-field Pu

null 11 Sep 10, 2022
Filament-spatie-laravel-activitylog - View your activity logs inside of Filament. ⚡️

View your activity logs inside of Filament. This package provides a Filament resource that shows you all of the activity logs created using the spatie

Ryan Chandler 45 Dec 26, 2022
A demo of how to use filament/forms to build a user-facing Form Builder which stores fields in JSON.

About Laravel Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experie

Dan Harrin 41 Dec 24, 2022
Makes working with DateTime fields in Laravel's Nova easier

This package adds a DateTime field with support for a global DateTime format, syntactic sugar for formatting individual DateTime fields and powerful d

wdelfuego 6 Aug 4, 2022
Laravel Livewire (TALL-stack) form generator with realtime validation, file uploads, array fields, blade form input components and more.

TALL-stack form generator Laravel Livewire, Tailwind forms with auto-generated views. Support Contributions Features This is not an admin panel genera

TinaH 622 Jan 2, 2023
Composer package which adds support for HTML5 elements using Laravels Form interface (e.g. Form::date())

Laravel HTML 5 Inputs Composer package which adds support for HTML5 elements by extending Laravel's Form interface (e.g. Form::date()) Adds support fo

Small Dog Studios 11 Oct 13, 2020
PlayZ is an esport event organization and management website allowing the creation of tournaments on the most popular video games of the esport scene.

PlayZ the playz to play Table of Contents Description "What is Playz?" In one sentence PlayZ is "an esport event organization and management website a

Antoine Saunier 2 Dec 7, 2021
🖼️ Laravel Nova Field for uploading and cropping images using Slim Image Cropper

??️ Laravel Nova Field for uploading and cropping images using Slim Image Cropper

Marius 5 Apr 2, 2022
This Laravel Nova package adds a Trumbowyg field to Nova's arsenal of fields.

Nova Trumbowyg Field This Laravel Nova package adds a Trumbowyg field to Nova's arsenal of fields. Requirements php: >=8.0 laravel/nova: ^4.0 Installa

outl1ne 3 Sep 25, 2022
A simple profile management page for Filament. ✨

A simple profile page for Filament. This package provides a very simple Profile page that allows the current user to manage their name, email address

Ryan Chandler 65 Jan 5, 2023
Add a general-purpose tools page to your Filament project. 🛠

Add a general-purpose tools page to your Filament project. Installation You can install the package via Composer: composer require ryangjchandler/fila

Ryan Chandler 24 Dec 6, 2022
A convenient helper for using the laravel-seo package with Filament Admin and Forms

Combine the power of Laravel SEO and Filament PHP. This package is a convenient helper for using the laravel-seo package with Filament Admin and Forms

Ralph J. Smit 39 Dec 21, 2022
Easily interact and control your feature flags from Filament

Easily interact and control your feature flags from Filament

Ryan Chandler 32 Nov 29, 2022
Admin user, role and permission management for Laravel Filament

Filament Access Control Opinionated setup for managing admin users, roles and permissions within Laravel Filament Features Separate database table for

Elisha Witte 69 Jan 4, 2023
Build structured navigation menus in Filament.

Build structured navigation menus in Filament. This plugin for Filament provides a Navigation resource that allows to build structural navigation menu

Ryan Chandler 61 Dec 30, 2022
Access laravel log through Filament admin panel

Access laravel log through Filament admin panel Features Syntax highlighting Quickly jump between start and end of the file Refresh log contents Clear

Guilherme Saade 20 Nov 22, 2022