You are here

protected function DatexPersianIntlCalendar::formatHook in Datex 8

Overrides DatexIntlCalendar::formatHook

File

src/Datex/DatexPersianIntlCalendar.php, line 33

Class

DatexPersianIntlCalendar

Namespace

Drupal\datex\Datex

Code

protected function formatHook($format, $value) {
  $characters = [
    '۰' => '0',
    '۱' => '1',
    '۲' => '2',
    '۳' => '3',
    '۴' => '4',
    '۵' => '5',
    '۶' => '6',
    '۷' => '7',
    '۸' => '8',
    '۹' => '9',
    '٠' => '0',
    '١' => '1',
    '٢' => '2',
    '٣' => '3',
    '٤' => '4',
    '٥' => '5',
    '٦' => '6',
    '٧' => '7',
    '٨' => '8',
    '٩' => '9',
  ];
  return strtr($value, $characters);
}