$format='d-m-Y';
$form['date'] = array(
'#type' => 'date_popup',
'#title' => t('Date'),
'#date_format' => $format,

);

download date_popup_authored module. It gives nice jquery calender with date picker instead of ugly dropdown calender with ‘#type’ =>’date’. While saving it to database use this format $date=substr(serialize($form_state[‘values’] [‘date’]),6,10); with date as varchar type in database

Advertisements