You are here

function datex_preprocess_node in Datex 7.3

Same name and namespace in other branches
  1. 7 datex.module \datex_preprocess_node()
  2. 7.2 datex.module \datex_preprocess_node()

Implements hook_preprocess_node().

Localizes 'published on' date.

Parameters

$variables:

File

./datex.module, line 339
Datex main module file, Datex adds php-intl support to drupal.

Code

function datex_preprocess_node(&$variables) {
  $calendar = datex_factory();
  if (!$calendar) {
    return;
  }
  $calendar
    ->setTimestamp($variables['created']);
  $format = variable_get('date_format_medium', 'D, m/d/Y - H:i');
  $variables['date'] = $calendar
    ->format($format);
  if (isset($variables['display_submitted'])) {
    $variables['submitted'] = t('Submitted by !username on !datetime', [
      '!username' => $variables['name'],
      '!datetime' => $variables['date'],
    ]);
  }
}