You are here

protected function CalendarSystemsPersianIntlCalendar::formatHook in Calendar Systems 8.3

Overrides CalendarSystemsIntlCalendar::formatHook

File

src/CalendarSystems/CalendarSystemsPersianIntlCalendar.php, line 37

Class

CalendarSystemsPersianIntlCalendar

Namespace

Drupal\calendar_systems\CalendarSystems

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);
}