You are here

function date_input_format in Date 8

Same name and namespace in other branches
  1. 5.2 date/date_elements.inc \date_input_format()
  2. 6.2 date/date_elements.inc \date_input_format()
  3. 6 date/date_elements.inc \date_input_format()
  4. 7.3 date_elements.inc \date_input_format()
  5. 7 date_elements.inc \date_input_format()
  6. 7.2 date_elements.inc \date_input_format()

Determine the input format for this element.

2 calls to date_input_format()
date_repeat_field_date_combo_process_alter in date_repeat_field/date_repeat_field.module
Implements hook_date_combo_process_alter().
hook_date_combo_process_alter in ./date.api.php
Alter the date_combo element after the Date module is finished with it.

File

./date_elements.inc, line 435
Date forms and form themes and validation.

Code

function date_input_format($element, $field, $instance) {
  if (!empty($instance['widget']['settings']['input_format_custom'])) {
    return $instance['widget']['settings']['input_format_custom'];
  }
  elseif (!empty($instance['widget']['settings']['input_format']) && $instance['widget']['settings']['input_format'] != 'site-wide') {
    return $instance['widget']['settings']['input_format'];
  }
  return variable_get('date_format_short', 'm/d/Y - H:i');
}