webridge/datetimepicker-bundle
A PHP bundle that adds a configurable date and time picker to your forms, with customizable formats, localization, and simple integration for selecting dates, times, or both in a single input field with minimal setup.
Before you composer require webridge/datetimepicker-bundle, understand what you are installing: this is a Symfony bundle, not a Laravel package. There is no service provider, no facade, no config/datetimepicker.php. The we-bridge/DatetimepickerBundle wraps a client-side datetime picker into a Symfony FormType (DateTimePickerType / DatePickerType), registering Twig form themes and an asset include. If you are in a Laravel codebase, the package will not autoload into your app in any usable way — the classes extend Symfony\Component\Form\AbstractType and register through Bundle/DependencyInjection conventions.
Minimal steps if you are in Symfony:
composer require webridge/datetimepicker-bundle (last tagged release 2015-02-11, so pin it and expect to resolve old symfony/form constraints).Webridge\DatetimepickerBundle\WebridgeDatetimepickerBundle in app/AppKernel.php (Symfony 2/3 era) or config/bundles.php (newer, if it happens to resolve).Resources/public and the bundle's Twig form theme block.DateTimePickerType in a form and render it; the picker initializes from the form theme's JS.First use case: a form field where users need to pick a date/time with a calendar widget instead of free-typing — e.g. an "event starts at" field — using the bundle's provided form type rather than hand-rolling <input type="datetime-local"> plus JS.
For Laravel developers specifically: treat this repo as reference material, not a dependency. The valuable part is the small amount of glue between the JS picker and the form type — read Form/Type/DateTimePickerType.php and the Twig theme to see the option names and widget config it exposes, then reproduce that with a Blade component + a modern picker (Flatpickr, Tempus Dominus, or native datetime-local). You will save more time than trying to bridge Symfony Forms into Laravel.
The bundle is thin, so patterns revolve around the form type rather than the bundle itself.
DateTimePickerType::class to a Symfony form builder. Pass options through the 'picker_options' (or similarly named array in the type) so JS-level config — format, min/max date, locale, time stepping — flows from PHP into the widget. This is the intended integration: keep configuration in the form class, not scattered in templates.templates/form/datetimepicker.html.twig (or your app's form theme) to adjust markup, add classes, or swap the JS bootstrap — this is the sanctioned extension point.App\...\PublishedAtType that sets sensible defaults, so every form gets identical picker behavior and formatting.NotBlank, DateTime, GreaterThan) on the entity/DTO. The type should map to a DateTime PHP value — verify it doesn't silently coerce.Resources/public contents into your pipeline and stop relying on the bundle's asset helper.providers entry, no published config, no Artisan commands, no Laravel service container bindings.symfony/form, symfony/framework-bundle, and PHP constraints. You will likely need --ignore-platform-reqs, symfony/phpunit-bridge style conflict resolution, or a fork. Pin to a commit and vendor it via a path repository if you must use it.Resources/public and the Twig theme for the expected global ($('#id').datetimepicker(...) or similar). If the referenced plugin version is ancient, you will hit jQuery/Bootstrap compatibility issues. Consider swapping the JS but keeping the PHP type as a thin adapter.DateTime parsing versus the client-side format string is the most common bug class: a picker set to MM/DD/YYYY feeding a PHP format expecting d/m/Y produces silent wrong dates or validation failures. Drive both from one config value and test the round trip (submit, hydrate entity, re-render).DateTime; if you store UTC, convert explicitly in the form PRE_SUBMIT/POST_SUBMIT or in a DTO transformer. Do not assume the picker sends timezone info.twig.form_themes or {% form_theme form 'bundle:Form:datetimepicker.html.twig' %}.How can I help you explore Laravel packages today?