You are here

function system_variable_option_date_format in Variable 7

Same name and namespace in other branches
  1. 7.2 includes/system.variable.inc \system_variable_option_date_format()

Callback for date types

@todo These should be different for some variables

1 string reference to 'system_variable_option_date_format'
system_variable_type_info in includes/system.variable.inc
Implements hook_variable_type_info().

File

includes/system.variable.inc, line 324
Variable API module. Definition for Drupal core variables

Code

function system_variable_option_date_format($variable, $options) {

  // Get list of all available date formats.
  $all_formats = array();
  foreach (system_get_date_formats() as $type => $format_info) {
    $all_formats = array_merge($all_formats, $format_info);
  }
  if ($custom_formats = system_get_date_formats('custom')) {
    $all_formats = array_merge($all_formats, $custom_formats);
  }
  foreach ($all_formats as $f => $format) {
    $list[$f] = format_date(REQUEST_TIME, 'custom', $f);
  }
  return $list;
}