You are here

function hijri_handler_hijri_created::render in Hijri 7

Same name and namespace in other branches
  1. 8 views/hijri_handler_hijri_created.inc \hijri_handler_hijri_created::render()

Hijri reneding.

Overrides views_handler_field_date::render

File

views/hijri_handler_hijri_created.inc, line 26
Definition of hijri handler created.

Class

hijri_handler_hijri_created
Hijri Created field displays the the node Created in hijri format.

Code

function render($values) {
  $format = $this->options['date_format'];
  $node = node_load($values->nid);
  $correction = isset($node->field_hijri_correction[$node->language][0]['value']);
  $value = $values->{$this->field_alias};
  switch ($format) {
    case 'hijri_full':
      return format_string(hijri_format_date($value, 'full', NULL, $correction));
    case 'hijri_long':
      return format_string(hijri_format_date($value, 'long', NULL, $correction));
    case 'hijri_medium':
      return format_string(hijri_format_date($value, 'medium', NULL, $correction));
    case 'hijri_short':
      return format_string(hijri_format_date($value, 'short', NULL, $correction));
    default:
      return parent::render($values);
  }
}