PHPackages                             pouyasoft\_ir/simple-date-bundle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. pouyasoft\_ir/simple-date-bundle

ActiveSymfony-bundle[Utility &amp; Helpers](/categories/utility)

pouyasoft\_ir/simple-date-bundle
================================

A bundle for persian date in Symfony2

7.1.3(11mo ago)87052[2 issues](https://github.com/msajadi824/simple-date-bundle/issues)MITPHPPHP &gt;=7.2.0

Since Mar 4Pushed 11mo ago2 watchersCompare

[ Source](https://github.com/msajadi824/simple-date-bundle)[ Packagist](https://packagist.org/packages/pouyasoft_ir/simple-date-bundle)[ RSS](/packages/pouyasoft-ir-simple-date-bundle/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (6)DependenciesVersions (10)Used By (0)

pouyasoft\_ir/simple-date-bundle
================================

[](#pouyasoft_irsimple-date-bundle)

**A bundle for persian date in Symfony2**

Install
-------

[](#install)

- **Install via Composer:**

```
$ php composer require pouyasoft_ir/simple-date-bundle

```

Service
-------

[](#service)

**Service Name:** pouya\_soft.j\_sdate\_service

**Functions:**

- **georgianToPersian:**
    Convert Georgian calendar (DateTime) To Persian (String).
    ***Parameters:***
    - georgian: DateTime (default: `null`)
    - format: string (default: `yyyy/MM/dd`) [View Intl Format](http://userguide.icu-project.org/formatparse/datetime)
    - locale: string (default: `fa`) (e.g. fa, fa\_IR, en, en\_US, en\_UK, ...)
    - calendar: string (default: `persian`) (e.g. gregorian, persian, islamic, ...)
    - latinizeDigit: bool (default: `false`) Convert Persian numbers to Latin Numbers.
- **persianToGeorgian:**
    Convert Persian calendar (String) To Georgian (DateTime).
    ***Parameters:***
    - persian: string
    - format: string (default: `yyyy/MM/dd`) [View Intl Format](http://userguide.icu-project.org/formatparse/datetime)
    - locale: string (default: `fa`) (e.g. fa, fa\_IR, en, en\_US, en\_UK, ...)
    - calendar: string (default: `persian`) (e.g. gregorian, persian, islamic, ...)
- **intlDateTimeInstance:**
    Return new Instance of IntlDateTime. [Visit Blog of Ali Farhadi](http://farhadi.ir/blog/1389/02/10/persian-calendar-for-php-53/)

**Sample:**

```
$shamsiString = $this->get('pouya_soft.j_sdate_service')->georgianToPersian(new \DateTime(), 'yyyy-MM-dd E');
//result: ۱۳۹۴-۱۱-۲۲ دوشنبه
$shamsiString = $this->get('pouya_soft.j_sdate_service')->persianToGeorgian('1394-11-22 دوشنبه', 'yyyy-MM-dd E');
//result: An instance of DateTime
```

Twig
----

[](#twig)

**Functions:**

- **gpDate:**
    Convert Georgian calendar (DateTime) To Persian (String).
    ***Parameters:***
    - georgian: DateTime (default: `null`)
    - format: string (default: `yyyy/MM/dd`) [View Intl Format](http://userguide.icu-project.org/formatparse/datetime)
    - locale: string (default: `fa`) (e.g. fa, fa\_IR, en, en\_US, en\_UK, ...)
    - calendar: string (default: `persian`) (e.g. gregorian, persian, islamic, ...)
    - latinizeDigit: bool (default: `false`) Convert Persian numbers to Latin Numbers.
- **pgDate:**
    Convert Persian calendar (String) To Georgian (DateTime).
    ***Parameters:***
    - persian: string
    - format: string (default: `yyyy/MM/dd`) [View Intl Format](http://userguide.icu-project.org/formatparse/datetime)
    - locale: string (default: `fa`) (e.g. fa, fa\_IR, en, en\_US, en\_UK, ...)
    - calendar: string (default: `persian`) (e.g. gregorian, persian, islamic, ...)

**Sample:**

```
{{ date|gpDate }}
{{ date|gpDate('yyyy-MM-dd E') }}
{{ '1394/11/22'|gpDate }}
{{ '1394-11-22 دوشنبه'|gpDate('yyyy-MM-dd E') }}
```

Form
----

[](#form)

**Type Name:** PouyaSoftSDateType

**Parameters:**

- serverFormat: string (default: `yyyy/MM/dd`) [View Intl Format](http://userguide.icu-project.org/formatparse/datetime)
- clientFormat: string (default: `yy/m/d`) [View DatePicker Format](https://api.jqueryui.com/datepicker/#utility-formatDate)
- attr: array
    You can add other DatePicker options to this param, but must change uppercase letters to lower and add dash before it. (see Samples)

***note:*** Result of serverFormat and clientFormat, must be the same.

**Sample:**

```
$builder
    ->add('date', PouyaSoftSDateType::class, [
        'serverFormat' => 'yyyy/MM/dd',
        'pickerOptions' => [
            'Format' => 'yyyy/MM/dd',
            'EnableTimePicker' => true,
            'GroupId' => 'group1',
            'FromDate' => true,
            'DisableBeforeToday' => true,
        ]
    ])
    ->add('date2', PouyaSoftSDateType::class, [
        'serverFormat' => 'yyyy-MM-dd E',
        'pickerOptions' => [
            'Format' => 'yyyy/MM/dd',
            'EnableTimePicker' => true,
            'GroupId' => 'group1',
            'ToDate' => true,
        ]
    ])
```

Date Picker
-----------

[](#date-picker)

**Requirements:**

- Bootstrap
- Jquery

**Add this lines to head tag in `base.html.twig` file:**

```

    ...

    ...

```

**Add this lines to end of body tag in `base.html.twig` file:**

```

```

**Add this lines to `config/packages/twig.yaml` file:**

```
twig:
    form_themes:
        - '@PouyaSoftSDate/form/form_s_date.html.twig'
```

**References:**

- [Blog of Ali Farhadi](http://farhadi.ir/blog/1389/02/10/persian-calendar-for-php-53/)
- [View Intl Format](http://userguide.icu-project.org/formatparse/datetime)
- [Class Intldateformatter](http://php.net/manual/en/class.intldateformatter.php)
- [MD.BootstrapPersianDateTimePicker](https://github.com/Mds92/MD.BootstrapPersianDateTimePicker)

###  Health Score

39

—

LowBetter than 85% of packages

Maintenance49

Moderate activity, may be stable

Popularity21

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~481 days

Recently: every ~414 days

Total

8

Last Release

344d ago

Major Versions

1.0.5 → 2.0.32017-10-22

2.0.3 → 3.0.42018-12-20

3.0.4 → 5.0.52020-11-13

5.0.6 → 7.1.12024-09-17

PHP version history (3 changes)1.0.5PHP &gt;=5.2

2.0.3PHP &gt;=5.3.0

5.0.5PHP &gt;=7.2.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/5941f2be3b4a3957b7abfe008565585e45b98db238e98dee0fa0f822b2c9e89c?d=identicon)[msajadi824](/maintainers/msajadi824)

---

Top Contributors

[![msajadi824](https://avatars.githubusercontent.com/u/4056919?v=4)](https://github.com/msajadi824 "msajadi824 (65 commits)")

---

Tags

intl-formatpersian-date-pickerpersian-datepickersymfonysymfony persian jalali shamsi date bundle

### Embed Badge

![Health badge](/badges/pouyasoft-ir-simple-date-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/pouyasoft-ir-simple-date-bundle/health.svg)](https://phpackages.com/packages/pouyasoft-ir-simple-date-bundle)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
