You are here

function date_input_format in Date 7

Same name and namespace in other branches
  1. 8 date_elements.inc \date_input_format()
  2. 5.2 date/date_elements.inc \date_input_format()
  3. 6.2 date/date_elements.inc \date_input_format()
  4. 6 date/date_elements.inc \date_input_format()
  5. 7.3 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_combo_element_process in ./date_elements.inc
Process an individual date element.
_date_repeat_widget in ./date_repeat.inc
Widget processing for date repeat form element.

File

./date_elements.inc, line 512
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');
}