Date dropdown year min/max [RESOLVED]

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

  1. Can I set the maximum year as “current”? So only current year we live in as a miximum
  2. Can I set the minimum as “current - 10”. So only 10 years back in time

Thanks

Already solved.
Added code below to a snippet and works perfectly

add_filter( 'gform_date_min_year', 'set_min_year' );
function set_min_year( $min_year ) {
    return $year = date("Y") - 25;
}

add_filter( 'gform_date_max_year', 'set_max_year' );
function set_max_year( $max_date ) {
    return $year = date("Y");
}

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.