Vaping_Community asked if it’s possible to add a class to a custom user field to use a datepicker. Steven suggested using a class like div.public-user-field.nameofthefield. However, Vaping_Community needed a more specific solution.
Vaping_Community found a solution using jQuery date picker and shared the code. tshenry helped improve the code by adding a condition to detect the profile page URL.
Canapin provided an updated code for the profile page, and nathank asked if it’s possible to limit the datepicker to just the year and if a searchable dropdown field can be created. cokestroke asked for help attaching a class to the field or replacing the QuerySelector class with a div id.
Could this be limited just to year? We are keen to know the approx age of our users for diversity monitoring and management, but don’t want to hold their full date of birth.
Also, is it possible to use this sort of method to have a searchable dropdown field (i.e. with 100s of options)?