You are here

function _date_views_handler_filter_date_value_form in Date 5

Same name and namespace in other branches
  1. 5.2 date/date_views.inc \_date_views_handler_filter_date_value_form()

Provide a form gadget for dates.

1 call to _date_views_handler_filter_date_value_form()
date_views_handler_filter_date_value_form in ./date.module

File

./date_views.inc, line 189

Code

function _date_views_handler_filter_date_value_form($field) {
  include_once drupal_get_path('module', 'date_api') . '/date.inc';
  $formats = date_get_formats($field);
  $format = $formats['input']['jscal'] ? $formats['input']['jscal'] : '';
  $form = array(
    '#type' => 'textfield',
    '#attributes' => array(
      'class' => 'jscalendar',
    ),
    '#jscalendar_ifFormat' => $format,
    '#jscalendar_showsTime' => date_has_time($field['granularity']) ? 'true' : 'false',
    '#jscalendar_timeFormat' => $formats['input']['am_pm'] ? '12' : '24',
  );
  return $form;
}