Skip to content

karadata/magentoPersianDate

Repository files navigation

Magento Persian Date

Persian (Jalali) calendar integration for Magento 2 — formatter, plugins, and admin UI.

Features

  • 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.

Installation

Drop the module under app/code/Behrad/PersianDate/, then run:

bin/magento module:enable Behrad_PersianDate
bin/magento setup:upgrade
bin/magento cache:flush

Quick start

/** @var \Behrad\PersianDate\Helper\Data $helper */
echo $helper->format(new DateTimeImmutable('2021-03-21'), 'l، j F Y');
// شنبه، ۱ فروردین ۱۴۰۰

Configuration

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.

License

MIT — see LICENSE.

About

No description, website, or topics provided.

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors