- Issue created by @mygumbo
- π¬π§United Kingdom joachim
I'd say use the hook that modifies the widget instead.
- πΊπΈUnited States mygumbo
Would that be hook_field_widget_complete_form_alter? Unsure how to target that specific field that uses the select widget for datetime.
- πΊπΈUnited States mygumbo
Does anyone have an example of modifying (any kind of) a profile field in the checkout pane? Thank you.
- π¬π§United Kingdom joachim
It actually sounds like you want the date field to so something fairly different to what it does OOTB.
What about a custom formatter? You can then set it up on a custom view mode, and IIRC you can select the view mode to use in the commerce checkout pane. - πΊπΈUnited States mygumbo
Thanks... I'm looking for something super simple - this works on the profile form itself:
case 'profile_registrant_edit_form': case 'profile_registrant_add_form': $form['field_date_of_birth']['widget'][0]['value']['#date_year_range'] = $max_age.':'.$min_age;