I have added a date element to my webform.
Now I want to change the date format for the date element.
I have used the following code.
function my_module_webform_element_alter(array &$element, FormStateInterface $form_state, array $context) {
if ($element['#type'] === 'date') {
$element['#date_date_format'] = 'd/m/Y';
}
}
But I can still see the date element like this.
And when I try to submit the form and I get an error on date field.
Also is there a way to change the date format in the email which webform sends?