PHPackages                             sorkh.shahin/jalalicalendar - 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. sorkh.shahin/jalalicalendar

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

sorkh.shahin/jalalicalendar
===========================

Jalali Calendar

v3.0.1(5y ago)04.1kMITPHPPHP &gt;=7.4CI failing

Since Jun 5Pushed 5y ago1 watchersCompare

[ Source](https://github.com/ShahinSorkh/JalaliCalendar)[ Packagist](https://packagist.org/packages/sorkh.shahin/jalalicalendar)[ Docs](https://github.com/ShahinSorkh/JalaliCalendar)[ RSS](/packages/sorkhshahin-jalalicalendar/feed)WikiDiscussions master Synced 4w ago

READMEChangelogDependencies (1)Versions (10)Used By (0)

JalaliCalendar
==============

[](#jalalicalendar)

A php native-like package for use of Persians and everyone who uses Jalali calendar and wants to get rid of Arabic characters in their php applications.

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

[](#installation)

You can use [composer](http://getcomposer.org) to install this calendar

```
$ composer require sorkh.shahin/jalalicalendar
```

Usage
-----

[](#usage)

This package is under `ShSo\Jalali` namespace and does two things:

1. Provides Jalali date/time using `ShSo\Jalali\DateTime` class
2. Converts English and Arabic numbers to Persian and vice versa using `ShSo\Jalali\Converter` class

### How to use

[](#how-to-use)

All methods and functionalities are static methods of the classes `ShSo\Jalali\DateTime` and `ShSo\Jalali\Converter`

`ShSo\Jalali\DateTime` provides:

- `date()`*Jalali equivalent of php native date() function with options to choose whether use Persian numbers and choose different timezone*
- `strftime()`*Jalali equivalent of php native strftime() function with options to choose whether use Persian numbers*
- `mktime()`*Jalali equivalent of php native mktime() function*
- `checkdate()`*Jalali equivalent of php native checkdate() function*
- `getdate()`*Jalali equivalent of php native getdate() function*
- `gregorianToJalali()`*Converts Gregorian date to Jalali*
- `jalaliToGregorian()`*Converts Jalali date to Gregorian*
- `dayOfYear()`*Returns number of passed days since the start of the year, `dayOfYear(6,8)` returns 163*
- `isLeapYear()`*Returns true if the given year is leap or false otherwise*
- `dayOfMonth()`*Returns number of days in the month, `dayOfMonth(12,1395)` returns 30*
- `getMonthName()`*Returns the name of the month, whether in full or short and in Persian or English*
- `getWeekName()`*Returns day of week in Gregorian order whether in Persian or English*
- `getShortWeekName()`*Returns day of week in Gregorian order in 3 letters whether in Persian or English*

`ShSo\Jalali\Converter` provides:

- `numToPersian()`*Converts all numbers whether in English or Arabic to Persian*
- `numToEnglish()`*Converts all numbers whether in Arabic or Persian to English*
- `arabicToPersian()`*Converts ('ي', 'ك', 'ة') to ('ی', 'ک', 'ه') and ('٤', '٥', '٦') to ('۴', '۵', '۶')*

License
-------

[](#license)

This package is under [MIT License](https://opensource.org/licenses/MIT).

###  Health Score

32

—

LowBetter than 69% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity69

Established project with proven stability

 Bus Factor1

Top contributor holds 93.3% 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 ~184 days

Recently: every ~362 days

Total

9

Last Release

1837d ago

Major Versions

v1.0.5 → v2.2.02018-03-11

v2.2.0 → v3.0.02021-06-20

PHP version history (2 changes)v1.0.0PHP &gt;=5

v3.0.0PHP &gt;=7.4

### Community

Maintainers

![](https://www.gravatar.com/avatar/9d4f33c60f32193d4015a160c15dc07319b2de4c0e55d00d8d23f636768afa61?d=identicon)[ShSo](/maintainers/ShSo)

---

Top Contributors

[![ShahinSorkh](https://avatars.githubusercontent.com/u/13497697?v=4)](https://github.com/ShahinSorkh "ShahinSorkh (14 commits)")[![jasverix](https://avatars.githubusercontent.com/u/22839684?v=4)](https://github.com/jasverix "jasverix (1 commits)")

---

Tags

calendarJalalipersianiranianjalali-calendartaghvim shamsi

###  Code Quality

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/sorkhshahin-jalalicalendar/health.svg)

```
[![Health](https://phpackages.com/badges/sorkhshahin-jalalicalendar/health.svg)](https://phpackages.com/packages/sorkhshahin-jalalicalendar)
```

###  Alternatives

[fisharebest/ext-calendar

Implementation of the Arabic (Hijri), French, Gregorian, Jewish, Julian and Persian (Jalali) calendars. Also provides a replacement for the PHP ext/calendar extension.

36513.6k11](/packages/fisharebest-ext-calendar)[opilo/farsi

Farsi Tools for Dates and Numbers and Strings (with Laravel Validation Support)

313.2k1](/packages/opilo-farsi)[symfony_persia/symfonyjdate

Jalali (Shamsi) DateTime for Symfony2, Supports year higher than 2038

1010.9k](/packages/symfony-persia-symfonyjdate)

PHPackages © 2026

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