Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Date Time Bundle

Date Time Bundle Laravel Package

mohebifar/date-time-bundle

A Symfony bundle that provides date and time form types with picker integration, making it easier to add date/time inputs and handle DateTime values cleanly in PHP applications.

View on GitHub
Deep Wiki
Context7

A Symfony2 Bundle to format DateTime to string according to a Calendar and a Datepicker FormType.

Frequently asked questions about Date Time Bundle
Is mohebifar/date-time-bundle a Laravel package?
No. It is a Symfony2 bundle built around Symfony's form component, Twig extensions, and bundle/DI registration, none of which exist in Laravel. There is no service provider, facade, config file, Blade directive, validation rule, or Eloquent cast. For Laravel you would be porting concepts, not adopting a dependency.
Can I install mohebifar/date-time-bundle with Composer in a Laravel project?
You can run the Composer command, but the install pulls Symfony Form and legacy Symfony components alongside Laravel, which is architecturally incoherent and likely to conflict. The composer.json PHP and symfony/* constraints predate PHP 8.1, so a current Laravel app will usually fail dependency resolution. The only defensible route is to read the source and extract the formatting logic rather than require it.
What does this date-time bundle actually do?
It provides Symfony form types for date and time input with picker integration, plus Twig filters for consistent rendering and formatting. Formats are configurable with sensible defaults, and the bundle registers itself through standard Symfony bundle and DI machinery. The core idea, keeping a native DateTime in the domain model and pushing calendar and display formatting to the view layer, is sound and framework agnostic.
Does it work with PHP 8 and modern Symfony versions?
It targets Symfony 2.x, which reached end of life in November 2018. That predicts PHP constraints older than PHP 8.1 and symfony/* constraints that conflict with anything a current Laravel release resolves. Treat it as a historical reference implementation, not a runtime dependency.
Can I reuse the date and time conversion logic without Symfony?
Possibly, but only after an audit. The portable piece is the calendar-aware formatting and conversion logic; the AbstractType form classes and the DI extension are not portable. If the pure functions are genuinely pure, extracting them into framework-free classes is a bounded spike measured in days rather than weeks. If the logic is entangled with Form internals, the correct decision is to stop and adopt a maintained alternative.
What are the best alternatives for date and time handling in Laravel?
Laravel already ships Carbon, which covers formatting, parsing, timezones, and casting dates on Eloquent models. PHP's IntlDateFormatter handles locale-aware output without any dependency. For Jalali or other non-Gregorian calendars, use maintained libraries such as morilog/jalali or hekmatinasser/verta rather than a fork of an abandoned bundle.
Is the bundle tested for leap years and month-length edge cases?
There is no evidence of a test suite in the repository. That matters disproportionately for calendar code, because leap-year rules, month-length variation, and year boundaries are exactly where it fails and exactly where untested code is dangerous. Verify this yourself before trusting any conversion it performs.
Is the package maintained, and is it safe to depend on in production?
With roughly 16 stars and 0 dependents there is no community triage, no security response path, and little realistic chance of an upstream fix. Symfony 2.x has been end of life since November 2018, so any future PHP or framework change is on you. Audit the license and provenance too, to confirm the code is original rather than vendored under different terms.
How do I replace the bundle's datepicker form type in a Laravel app?
The FormType half depends on symfony/form and FormBuilderInterface, which Laravel does not ship, so it does not translate. In Laravel, date selection belongs in a Blade or Livewire component backed by a client-side datepicker, with server-side validation and a Carbon or datetime Eloquent cast. Keep formatting at the presentation edge and leave the model holding a native DateTime.
Should I fork this bundle or write my own date formatting code?
Mine it, don't install it. Time-box an audit, separate the pure conversion and formatting functions from the Symfony-coupled classes, and record a short finding of portable, entangled, or not worth it. Only wrap the extracted functions in a service provider and facade if the audit says portable. If IntlDateFormatter already meets the requirement, the only differentiated piece is the widget, which you should build or vendor elsewhere.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
jinas/dhivatar
store-doc/laravel-storage-driver
plus-it/laravel-translation-manager
diephp/perhaps
diephp/telegraph
osmaviation/spreadsheet
microsoft/fluentui-system-icons
mmccook/php-json-canonicalization-scheme
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console
pnscripts/filament-broadquill-lite
pnscripts/laravel-sentfold-lite
vleap/mx-sdk-laravel-internal
twidpay/utils
htetmyathlaing/scout-elasticsearch-driver
artisan-toolbox/front-awesome
ls/client-assistant
users-au/laravel-client
cgv/localized-resource