Drupal: How should I implement hook_schema, then to use Date module's date_select in my form
I am creating new node type in my drupal module. It is the first time I want to create new node type without CCK :)
Which data type should I use in hook_schema
, then to use date_select
field in hook_form
?
function mymodule_schema() {
$schema['mymodule']['call_time'] = array(
'type' => 'datetime', // which data type should I use?
开发者_如何转开发'not null' => TRUE,
);
}
function mymodule_form(&$node, $form_state) {
$form['call_time'] = array(
'#type' => 'date_select',
// ... other options
);
}
Thanks in advance!
Maybe a little late...
Can't you really use datetime
as in your example?
At least, according to Drupal documentation: http://drupal.org/node/159605
drupal core does not include "datetime". you need to use the "date"-module.
精彩评论