PHPackages                             shahimian/yii2-dategj - 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. shahimian/yii2-dategj

ActiveYii2-extension[Utility &amp; Helpers](/categories/utility)

shahimian/yii2-dategj
=====================

it convert Gregorian date to Jalali calendar one.

1.0.5(6y ago)1371MITPHP

Since Sep 7Pushed 6y agoCompare

[ Source](https://github.com/shahimian/yii2-dategj)[ Packagist](https://packagist.org/packages/shahimian/yii2-dategj)[ RSS](/packages/shahimian-yii2-dategj/feed)WikiDiscussions master Synced 4d ago

READMEChangelog (6)Dependencies (1)Versions (7)Used By (1)

Date GJ
=======

[](#date-gj)

it convert Gregorian date to Jalali calendar one.

Installation
------------

[](#installation)

The preferred way to install this extension is through [composer](http://getcomposer.org/download/).

Either run

```
php composer.phar require --prefer-dist shahimian/yii2-dategj "*"

```

or add

```
"shahimian/yii2-dategj": "*"

```

to the require section of your `composer.json` file.

Usage
-----

[](#usage)

Once the extension is installed, simply use it in your code by normally:

```

```

You can set another value in `$dt->datetime` later if you want.

Method Details
--------------

[](#method-details)

You use various methods in this class presented in list below:

**public string gj()**

gets `$dt->datetime` it formats `YYYY-MM-DD HH:MM` as Gregorian date and converting that same format as Jalali date.

**public Array convertor()**

gets argument with upper format and converting as array. it contains 3 cells for year, month and day.

**public integer year()**

gets argument and returning converted year number.

**public integer month()**

gets argument and returning converted month number.

**public integer day()**

gets argument and returning converted day number.

**public string month\_name($month : integer)**

gets month number and returning month name as farsi language.

**public string full\_date()**

return full date contains year, month and day as farsi language.

**public string weekday()**

return a day of the week as farsi language.

**public Array dateSegment()**

return Array that is year, month and day for its indeces respectively.

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity62

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 ~7 days

Total

6

Last Release

2404d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/2282edfb3dbe7d89c030618bab069f5064b7d4a482bbae3548a63dd8645f9058?d=identicon)[shahimian](/maintainers/shahimian)

---

Top Contributors

[![MAShahimian](https://avatars.githubusercontent.com/u/189714651?v=4)](https://github.com/MAShahimian "MAShahimian (9 commits)")

---

Tags

convertdateyii2extensionJalali

### Embed Badge

![Health badge](/badges/shahimian-yii2-dategj/health.svg)

```
[![Health](https://phpackages.com/badges/shahimian-yii2-dategj/health.svg)](https://phpackages.com/packages/shahimian-yii2-dategj)
```

###  Alternatives

[kartik-v/yii2-widget-datepicker

Enhanced Yii2 wrapper for the bootstrap datepicker plugin (sub repo split from yii2-widgets).

1097.0M60](/packages/kartik-v-yii2-widget-datepicker)[kartik-v/yii2-date-range

An advanced Yii 2 date range picker input for based on bootstrap-daterangepicker plugin.

894.4M42](/packages/kartik-v-yii2-date-range)[kartik-v/yii2-datecontrol

Date control module allowing separation of formats for View and Model for Yii Framework 2.0

551.5M36](/packages/kartik-v-yii2-datecontrol)[kartik-v/yii2-field-range

Easily manage Yii 2 ActiveField ranges (from/to) with Bootstrap 3 addons markup and more

232.1M26](/packages/kartik-v-yii2-field-range)[dmstr/yii2-cookie-consent

Yii2 Cookie Consent Widget

1452.6k](/packages/dmstr-yii2-cookie-consent)

PHPackages © 2026

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