<?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: prorated dates question</title>
		<link>https://legacy.forums.gravityhelp.com/topic/prorated-dates-question</link>
		<description>Gravity Support Forums Topic: prorated dates question</description>
		<language>en-US</language>
		<pubDate>Sun, 19 Apr 2026 20:21:36 +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/prorated-dates-question" rel="self" type="application/rss+xml" />

		<item>
			<title>Chris Hajer on "prorated dates question"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/prorated-dates-question#post-70267</link>
			<pubDate>Thu, 09 Aug 2012 01:14:08 +0000</pubDate>
			<dc:creator>Chris Hajer</dc:creator>
			<guid isPermaLink="false">70267@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Can you export the form as XML please and email it to me at &#60;a href=&#34;mailto:chris@rocketgenius.com&#34;&#62;chris@rocketgenius.com&#60;/a&#62; - thank you.  Please reference this topic in your email.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>NextFab on "prorated dates question"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/prorated-dates-question#post-70170</link>
			<pubDate>Wed, 08 Aug 2012 12:24:23 +0000</pubDate>
			<dc:creator>NextFab</dc:creator>
			<guid isPermaLink="false">70170@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Correct. I need to display the number of days left in the month, before the form is submitted.&#60;br /&#62;
I don't have the form online yet. I running it on test server.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Chris Hajer on "prorated dates question"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/prorated-dates-question#post-70041</link>
			<pubDate>Tue, 07 Aug 2012 21:58:28 +0000</pubDate>
			<dc:creator>Chris Hajer</dc:creator>
			<guid isPermaLink="false">70041@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Do you have this online somewhere so we can take a look at it?  What happens with this code currently?  And are you trying to pre-populate the form with the number of days left, so you can show the price, BEFORE the form is submitted?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>NextFab on "prorated dates question"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/prorated-dates-question#post-69876</link>
			<pubDate>Tue, 07 Aug 2012 11:05:12 +0000</pubDate>
			<dc:creator>NextFab</dc:creator>
			<guid isPermaLink="false">69876@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Hello,&#60;/p&#62;
&#60;p&#62;I am trying to populate the value in the field based on the value entered, in this case date, dynamically. I am trying to calculate prorated dates till the end of the month and based on that to calculate the price.&#60;br /&#62;
The problem is, I don't seem to find the way how to make the value appear without the page refreshing. Any workarounds?&#60;br /&#62;
I appreciate any help you can give me.&#60;br /&#62;
Thanks,&#60;br /&#62;
Yulia&#60;/p&#62;
&#60;p&#62;Here is the code I am starting of:&#60;br /&#62;
&#60;pre&#62;&#60;code&#62;add_filter(&#38;#39;gform_field_value_prorated_days&#38;#39;, &#38;#39;get_prorated_days&#38;#39;);

function get_prorated_days($form){

    $start_date = $_POST[&#38;quot;input_5&#38;quot;]; //NOTE: replace 2 with your actual start date input ID
    $arr = explode(&#38;#39;/&#38;#39;, $start_date);
    //$end_date = date(&#38;#39;%m/%t/%Y&#38;#39;, strtotime($arr[0].&#38;#39;/01/&#38;#39;.$arr[2]));  //
    $ldom = date(&#38;#39;%t&#38;#39;, strtotime($arr[0].&#38;#39;/01/&#38;#39;.$arr[2]));
    $end_date = $arr[0].&#38;quot;$ldom&#38;quot;.$arr[2];
    $days = gf_date_diff($start_date, $end_date);

    $arr2 = explode(&#38;#39;&#124;&#38;#39;, $_POST[&#38;quot;input_6&#38;quot;]);
    $daily_rate = round($arr2[1]/$ldom);

    $pamt = floatval($daily_rate) * floatval($days);
    //$_POST[&#38;quot;input_17&#38;quot;] = floatval($daily_rate) * floatval($days);
    return $pamt;
}

function gf_date_diff($start, $end) {
    $start_ts = strtotime($start);
    $end_ts = strtotime($end);
    $diff = $end_ts - $start_ts;
    return round($diff / 86400);
}&#60;/code&#62;&#60;/pre&#62;</description>
		</item>

	</channel>
</rss>
