corvet / light-field-bundle
Custom date fields with masked for Symfony 8
Package info
github.com/corvet/light-field-bundle
Type:symfony-bundle
pkg:composer/corvet/light-field-bundle
v1.0.1
2026-05-21 20:47 UTC
Requires
- php: >=8.4
- symfony/form: 8.0.*
- symfony/framework-bundle: 8.0.*
- symfony/twig-bundle: 8.0.*
Requires (Dev)
- phpunit/phpunit: ^11.0
- symfony/phpunit-bridge: ^8.0
README
Custom masked date input field with integrated Flatpickr calendar and custom footer buttons (Today / Clear) for Symfony 8+ and AssetMapper (Symfony UX).
Features
- Inputmask integration (formats text as
dd.mm.yyyydynamically). - Flatpickr integration (dark theme by default).
- Custom Footer Buttons: Single-click buttons for "Today" and "Clear" that work perfectly with the input mask without stripping data.
- Zero Node/NPM dependencies (built natively for Symfony AssetMapper).
Installation
1. Download the Bundle
Run the following command in your Symfony project:
composer require corvet/light-field-bundle
2. Install JavaScript Dependencies
Since this bundle relies on flatpickr and inputmask via AssetMapper, import them into your application's importmap.php:
php bin/console importmap:require flatpickr inputmask
Usage
Simply use MaskedDateType::class in your Symfony forms:
use Corvet\LightFieldBundle\Form\MaskedDateType; use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\FormBuilderInterface; class OrderType extends AbstractType { public function buildForm(FormBuilderInterface $builder, array $options): void { $builder->add('createdAt', MaskedDateType::class, [ 'label' => 'Select Date', ]); } }
License
MIT License. See LICENSE for more information.