Persian (Jalali) calendar integration for Magento 2 — formatter, plugins, and admin UI.
- Pure-PHP Gregorian ↔ Jalali conversion (no system locale dependency).
date()-style formatter with Persian month/weekday names and digit substitution.- Plugins that transparently render order, customer, and product timestamps in Jalali.
- Admin configuration: enable/disable, date format, digit style, timezone.
- ViewModel + Block helpers for storefront and adminhtml templates.
- Unit-test coverage for the calendar core, formatter, helper, view model, and plugins.
Drop the module under app/code/Behrad/PersianDate/, then run:
bin/magento module:enable Behrad_PersianDate
bin/magento setup:upgrade
bin/magento cache:flush/** @var \Behrad\PersianDate\Helper\Data $helper */
echo $helper->format(new DateTimeImmutable('2021-03-21'), 'l، j F Y');
// شنبه، ۱ فروردین ۱۴۰۰Stores → Configuration → Behrad → Persian Date:
| Field | Default | Notes |
|---|---|---|
| Enabled | Yes | Master switch for all plugins. |
| Date format | Y/m/d H:i |
Same tokens as PHP date(), see API docs. |
| Use Persian digits | Yes | Replace 0-9 with ۰-۹ in output. |
| Timezone | Asia/Tehran |
Used when interpreting incoming DateTimeInterface values. |
MIT — see LICENSE.