Strangely my popup calendar is localized, showing day names and so on in correct language, but not the date in the textfield neither in the description, which remained Y-m-d formatted.
.
This should be french format : d-m-Y . And I also need to change default value from today to next week. So, as per this answer :
(For date popup) Branch 7.x-2 : Implementing
hook_date_popup_process_alter()
you could remove the description...
I tried these diff snippets :
function vts_commerce_date_popup_process_alter(&$element, &$form_state, $context) {
$element['#date_format'] = 'd-m-Y';//no effect
$element['date']['#date_format'] = 'd-m-Y';//no effect
$element['#default_value'] = date('d-m-Y', strtotime('+1 week'));//no effect
unset($element['date']['#description']);//works but I need to display it with correct date format instead
dsm($element);
return $element;
}
From which snippets 4 changes the form element. Instead, snippets 1, 2, 3 changed $element into dsm()
returned values, but change nothing in the form. So my questions are:
- How to display date into the textfield and in its description in french format ? how to change the default value that will be shown on page loading ?
- What is the difference here between
$element['#foo']
and$element['date']['#foo']
?
Many thanks for your replies.