The following code is used to set the min and max dates in a date drop down field
add_filter( 'gform_date_min_year', 'set_min_year' );
function set_min_year( $min_year ) {
return 1900;
}
and
add_filter( 'gform_date_max_year', 'set_max_year' );
function set_max_year( $max_date ) {
return 2022;
}
2 questions
- Can I set the maximum year as “current”? So only current year we live in as a miximum
- Can I set the minimum as “current - 10”. So only 10 years back in time
Thanks