date_test.module in Date 7.2
Same filename and directory in other branches
Contains date test implementations.
File
tests/date_test/date_test.moduleView source
<?php
/**
* @file
* Contains date test implementations.
*/
/**
* Implements hook_menu().
*/
function date_test_menu() {
$items['date-test/form'] = array(
'title' => 'Test form with date element',
'description' => "Form with date element to make form related tests",
'page callback' => 'drupal_get_form',
'page arguments' => array(
'date_test_sample_form',
),
'access arguments' => array(
'access content',
),
'type' => MENU_CALLBACK,
);
return $items;
}
/**
* Form callback. Generates a test form with date elements.
*/
function date_test_sample_form($form, &$form_state) {
$form['date_test_select'] = array(
'#type' => 'date_select',
'#title' => t('Sample from'),
'#date_format' => 'H:i:s a',
'#default_value' => array(
'hour' => 7,
'minute' => 0,
'second' => 0,
'ampm' => 'am',
),
);
return $form;
}
Functions
Name![]() |
Description |
---|---|
date_test_menu | Implements hook_menu(). |
date_test_sample_form | Form callback. Generates a test form with date elements. |