I had used the date module in Drupal 6 for my custom module.But in Drupal 7, i am getting this error
Fatal error: Call to undefined function date_popup_load() in C:\xampp\htdocs\widgetcorp\sites\all\modules\freeway\freeway.admin.inc on line 164
This is the form iam using it in is as follows.
function create_freeway_project (){
$node = node_load(arg(1));
$form = array();
date_popup_load();
$form['title'] = array(
'#type' => 'textfield',
'#title' => t('Project Description'),
'#size' => 60,
'#maxlength' => 128,
'#required' => TRUE,
);
$form['custRef'] = array(
'#type' => 'textfield',
'#title' => t('Customer Reference'),
'#size' => 60,
'#maxlength' => 128,
'#required' => TRUE,
);
$form['poRef'] = array(
'#type' => 'textfield',
'#title' => t('PO Reference'),
'#size' => 60,
'#maxlength' => 128,
'#required' => TRUE,
);
$form['splinst'] = array(
'#type' => 'textarea',
'#title' => t('Special Instructions'),
'#size' => 60,
'#maxlength' => 128,
'#required' => TRUE,
);
$form['strtdate'] = array(
'#type' => 'date_popup',
'#title' => t('Delivery Date'),
'#size' => 60,
'#maxlength' => 128,
'#required' => TRUE,
);
$form['enddate'] = array(
'#type' => 'date_popup',
'#title' => t('End Date'),
'#size' => 60,
'#maxlength' => 128,
'#required' => TRUE,
);
$form['create_project_btn'] = array(
'#type' => 'submit',
'#value' => 'Create Freeway Project',
);
return $form;
}
Is the Jquery_UI module to be added ? I did not find its mention in the Date module for Drupal 7.
Please let me know if i am missing something.
Thanks
A
You don’t need to do any of the setup yourself in Drupal 7, it’s as simple as this:
The date module will handle adding the required JS.
Have a look at the
date_popup_element_info()function for a full list of the available options for this element type.