<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="bbPress/1.0.1" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>Gravity Support Forums Topic: Help with Date and Time Fields</title>
		<link>https://legacy.forums.gravityhelp.com/topic/help-with-date-and-time-fields</link>
		<description>Gravity Support Forums Topic: Help with Date and Time Fields</description>
		<language>en-US</language>
		<pubDate>Sun, 05 Apr 2026 20:00:09 +0000</pubDate>
		<generator>http://bbpress.org/?v=1.0.1</generator>
		<textInput>
			<title><![CDATA[Search]]></title>
			<description><![CDATA[Search all topics from these forums.]]></description>
			<name>q</name>
			<link>https://legacy.forums.gravityhelp.com/search.php</link>
		</textInput>
		<atom:link href="https://legacy.forums.gravityhelp.com/rss/topic/help-with-date-and-time-fields" rel="self" type="application/rss+xml" />

		<item>
			<title>Steve Napierski on "Help with Date and Time Fields"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/help-with-date-and-time-fields#post-234158</link>
			<pubDate>Thu, 02 May 2013 19:31:32 +0000</pubDate>
			<dc:creator>Steve Napierski</dc:creator>
			<guid isPermaLink="false">234158@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Setting the minimum and maximum year can be accomplished by adding the following code to your functions.php file:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;add_filter(&#38;quot;gform_date_max_year&#38;quot;, &#38;quot;set_max_year&#38;quot;);
function set_max_year($max_year){
    return 2016;
}
add_filter(&#38;quot;gform_date_min_year&#38;quot;, &#38;quot;set_min_year&#38;quot;);
function set_min_year($min_year){
    return 2013;
}&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;Now limiting the hour and minute will require adding a little jQuery to you form's page template. Using the following code will cause any hour less than 1 to change to 1 and any number greater than 12 to turn into 12. Same goes for the minute. Any number less than 0 will turn to 0 and any number greater than 59 will turn to 59.&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;&#38;lt;script type=&#38;#39;text/javascript&#38;#39;&#38;gt;
jQuery(document).ready(function( $ ) {
$(&#38;#39;#input_3_2_1&#38;#39;).change(function() {
if ($(this).val() &#38;lt; 1){ $(this).val(1);}
if ($(this).val() &#38;gt; 12){ $(this).val(12);}
});
$(&#38;#39;#input_3_2_2&#38;#39;).change(function() {
if ($(this).val() &#38;lt; 0){ $(this).val(0);}
if ($(this).val() &#38;gt; 59){ $(this).val(59);}
});
});
&#38;lt;/script&#38;gt;&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;You will just need to change 'input_3_2_1' to the ID of your hour form select and 'input_3_2_2' to the ID of your minute form select. You locate their IDs by viewing the page source of your form.&#60;/p&#62;
&#60;p&#62;I hope this answers your questions.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>MacTTU on "Help with Date and Time Fields"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/help-with-date-and-time-fields#post-234113</link>
			<pubDate>Thu, 02 May 2013 18:21:03 +0000</pubDate>
			<dc:creator>MacTTU</dc:creator>
			<guid isPermaLink="false">234113@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;AustinGolfEvents.com/Add&#60;/p&#62;
&#60;p&#62;My issue is hopefully pretty simple.&#60;/p&#62;
&#60;p&#62;1. I want the Date(year) to be from 2013-2016 instead of 1920-2014&#60;/p&#62;
&#60;p&#62;2. I want the time fields to only allow actual times.....Right now I can enter in 39:82 PM and the form will accept it?  How do I get it so the hours go to 12 and the minutes go to 60.&#60;/p&#62;
&#60;p&#62;Thanks in advance for your help...........sorry I'm a newb!&#60;/p&#62;
&#60;p&#62;Mac
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
