开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜