You are here

function datex_date_date_formatter_dates_alter in Datex 7

Implemetns hook_date_formatter_dates_alter().

Converts gregorian date to Jalali date before display (such as node view).

File

datex_date/datex_date.module, line 32
Provides Jalali support for date module.

Code

function datex_date_date_formatter_dates_alter(&$dates, $context) {
  if (_datex_date_skip_field($context)) {
    return;
  }
  foreach ($dates as $name => &$date) {
    $dates[$name]['formatted'] = DatexFormatter::format(strtotime($date['local']['datetime']), $context['format'], DatexFormatter::getTzObject($date['local']['timezone']), _datex_intl());
  }
}