首页 > 代码库 > drupal7 怎样将一个date字段加入上日期插件效果

drupal7 怎样将一个date字段加入上日期插件效果

//这里以created字段为样例
function    Hook_form_alter($form,$form_state,$form_id){
   $form['created']['#type'] = 'date_popup';
   $form['created']['#date_format'] = 'Y-m-d';
   $form['created']['#size'] = 20;
   $form['created']['#attributes']['readonly'] = true;
   $form['created']['#date_label_position'] = 'within';}


drupal7 怎样将一个date字段加入上日期插件效果