1 date.module date_formatter_format($formatter, $settings, $granularity = array(), $langcode = NULL)

Retrieve a date format string from formatter settings.

File

core/modules/date/date.module, line 429
Defines date/time field types.

Code

function date_formatter_format($formatter, $settings, $granularity = array(), $langcode = NULL) {
  $format_type = !empty($settings['format_type']) ? $settings['format_type'] : 'format_interval';

  switch ($formatter) {
    case 'format_interval':
      return 'format_interval';

    case 'date_plain':
      return 'date_plain';

    default:
      $format = date_format_type_format($format_type, $langcode);
      break;
  }

  // A selected format might include timezone information.
  array_push($granularity, 'timezone');
  return date_limit_format($format, $granularity);
}