1 views_handler_filter_date.inc views_handler_filter_date::value_form(&$form, &$form_state)

Add a type selector to the value form

Overrides views_handler_filter_numeric::value_form

File

core/modules/views/handlers/views_handler_filter_date.inc, line 26
Definition of views_handler_filter_date.

Class

views_handler_filter_date
Filter to handle dates stored as a timestamp.

Code

function value_form(&$form, &$form_state) {
  if (empty($form_state['exposed'])) {
    $form['value']['type'] = array(
      '#type' => 'radios',
      '#title' => t('Value type'),
      '#options' => array(
        'date' => t('A date in any machine readable format. CCYY-MM-DD HH:MM:SS is preferred.'),
        'offset' => t('An offset from the current time such as "!example1" or "!example2"', array('!example1' => '+1 day', '!example2' => '-2 hours -30 minutes')),
      ),
      '#default_value' => !empty($this->value['type']) ? $this->value['type'] : 'date',
    );
  }
  parent::value_form($form, $form_state);
}