You are here

function calendar_date_select_form in Calendar 5.2

Same name and namespace in other branches
  1. 6.2 calendar.module \calendar_date_select_form()
  2. 7 calendar.module \calendar_date_select_form()
  3. 7.2 calendar.module \calendar_date_select_form()

The date selector form.

@TODO is the title desired here or does it take up too much space??

Parameters

object $view:

Return value

the form element

1 string reference to 'calendar_date_select_form'
calendar_date_select in ./calendar.module
A selector to jump to a new date in the calendar.

File

./calendar.module, line 939
Adds calendar filtering and displays to Views.

Code

function calendar_date_select_form($view) {
  $format = date_limit_format(variable_get('date_format_short', 'm/d/Y - H:i'), array(
    'year',
    'month',
    'day',
  ));
  $form['calendar_goto'] = array(
    //'#title' => t('Calendar date'),
    '#type' => module_exists('date_popup') ? 'date_popup' : 'date_select',
    '#default_value' => date_format($view->min_date, DATE_FORMAT_DATE),
    '#date_timezone' => date_default_timezone_name(),
    '#date_format' => $format,
    '#date_label_position' => 'none',
  );
  $form['calendar_type'] = array(
    '#type' => 'hidden',
    '#value' => $view->calendar_type,
  );
  $form['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Change date'),
  );
  return $form;
}