Weave Code
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

Jalali Date Time Bundle Laravel Package

borsaco/jalali-date-time-bundle

View on GitHub
Deep Wiki
Context7

JalaliDateTimeBundle

A bundle to using jlali date time in Symfony applications

Install

Via Composer

composer require borsaco/jalali-date-time-bundle

Edit your app/AppKernel.php to register the bundle in the registerBundles() method as above:

class AppKernel extends Kernel
{

    public function registerBundles()
    {
        $bundles = array(
            // ...
            // register the bundle here
            new Borsaco\JalaliDateTimeBundle\JalaliDateTimeBundle()
        );
    }
}

Usage

Wherever you have access to the service container :

<?php
    // get the jlali date as a service
    $jlaliDateTime = $this->container->get('jalali_date_time');

    $jlaliDateTime->date('l j F Y H:i');
    $jlaliDateTime->date('Y-m-d', false, false);
    $jlaliDateTime->date('Y-m-d', false, false, false);
    $jlaliDateTime->date("l j F Y H:i T", false, null, null, 'America/New_York');
    
    // convert to jalali
    $unixDatetime = date("U");
    $jlaliDateTime->date('l j F Y H:i', $unixDatetime);

?>

For use the form type add JalaliDateType form type and create your view with this library: https://github.com/beygi/bootstrap-persian-datetimepicker

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.
besmartand-pro/php-quality-config
sentix/ai-chatbot
terminal42/code-quality-tools
codifyo/ts-generator-bundle
testo/fiber
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity