1 date.module date_format_type_options()

Creates an array of date format types for use as an options list.

File

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

Code

function date_format_type_options() {
  $options = array();
  $format_types = system_get_date_formats();
  if (!empty($format_types)) {
    foreach ($format_types as $type => $type_info) {
      if (isset($type_info['label'])) {
        $options[$type] = $type_info['label'] . ' (' . date_format_date(date_example_date(), $type) . ')';
      }
    }
  }
  return $options;
}