function hijri_handler_hijri_created::render in Hijri 8
Same name and namespace in other branches
- 7 views/hijri_handler_hijri_created.inc \hijri_handler_hijri_created::render()
File
- views/
hijri_handler_hijri_created.inc, line 20 - 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 = $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);
}
}