How to remove the default date format option added by date module ?
How to Change the Title, Change the description ("E.g., 29/07/2016") of the date widget ?
Question
For thah you must use an additional process.
1. Create a custom module (Example : Here we use mymodule)
2. in the mymodule.module, add the hook hook_alter_element_info_alter and create a function '_mymodule_date_popup_process_alter'
Ex:
/**
* implements hook_element_info_alter()
*
*/
function mymodule_alter_element_info_alter(&$type) {
if (isset($type['date_popup'])) {
$type['date_popup']['#process'][] = '_mymodule_date_popup_process_alter';
}
}
function _mymodule_date_popup_process_alter(&$element, &$form_state, $context) {
unset($element['date']['#description']);
if ($element['#name'] == 'node_changed') {
$element['date']['#title'] = "The Date is";
}
return $element;
}
Comments