PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

gform_date_min_year not working

  1. I have used this documentation to modify the date fields on a form:
    http://www.gravityhelp.com/documentation/page/Gform_date_min_year

    So I have put this in my functions.php file but it does not change the minimum year from the selection list to 2012. It still shows years back to 1912:

    // Date fields on forms will be looking for a date going foward. So make the minimum year the
    // the current one.
    add_filter("gform_date_min_year", "set_min_year");
    function set_min_year($min_year){
    	return intval(date("Y"));
    }

    Any thoughts on why this might not be working?

    Posted 12 years ago on Wednesday March 21, 2012 | Permalink
  2. I misunderstood the gform_date_min_year and gform_date_max_year filters. These filters affect a date field only if it's using the drop down date input type. I was thinking it modified the min and max years that are available via the Date Picker jquery option.

    Posted 12 years ago on Thursday March 22, 2012 | Permalink