You are here

public function FrxControls::drupal_date_format in Forena Reports 7

Same name and namespace in other branches
  1. 6.2 plugins/FrxControls.inc \FrxControls::drupal_date_format()
  2. 6 plugins/FrxControls.inc \FrxControls::drupal_date_format()
  3. 7.2 plugins/FrxControls.inc \FrxControls::drupal_date_format()
  4. 7.3 plugins/FrxControls.inc \FrxControls::drupal_date_format()
  5. 7.4 plugins/FrxControls.inc \FrxControls::drupal_date_format()
1 call to FrxControls::drupal_date_format()
FrxControls::iso_date in plugins/FrxControls.inc

File

plugins/FrxControls.inc, line 47
contains various methods for extending report formating, layout, transformation and design.

Class

FrxControls
@file contains various methods for extending report formating, layout, transformation and design.

Code

public function drupal_date_format($value, $format_str) {
  if (!$format_str) {
    $format_str = 'small';
  }
  switch ($format_str) {
    case 'medium':
      $type = $format_str;
      $format = '';
      break;
    case 'small':
      $type = $format_str;
      $format = '';
      break;
    case 'large':
      $type = $format_str;
      $format = '';
      break;
    default:
      $type = 'custom';
      $format = $format_str;
  }
  return $value ? format_date($value, $type, $format) : '';
}