<?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: Custom configured datepicker not passing the validation</title>
		<link>https://legacy.forums.gravityhelp.com/topic/custom-configured-datepicker-not-passing-the-validation</link>
		<description>Gravity Support Forums Topic: Custom configured datepicker not passing the validation</description>
		<language>en-US</language>
		<pubDate>Sat, 04 Apr 2026 12:22:02 +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/custom-configured-datepicker-not-passing-the-validation" rel="self" type="application/rss+xml" />

		<item>
			<title>Rob Harrell on "Custom configured datepicker not passing the validation"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/custom-configured-datepicker-not-passing-the-validation#post-189580</link>
			<pubDate>Fri, 29 Mar 2013 15:09:36 +0000</pubDate>
			<dc:creator>Rob Harrell</dc:creator>
			<guid isPermaLink="false">189580@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Handling via priority support.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>bluantinoo on "Custom configured datepicker not passing the validation"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/custom-configured-datepicker-not-passing-the-validation#post-188906</link>
			<pubDate>Fri, 29 Mar 2013 05:44:08 +0000</pubDate>
			<dc:creator>bluantinoo</dc:creator>
			<guid isPermaLink="false">188906@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Update: I think that the problem is on date format definition, and that the error shows up everytime I choose a day after the 12th day of the month, just because it missplace the day for the month.&#60;/p&#62;
&#60;p&#62;even if I define a customdateFormat as &#34;dd-mm-yy&#34; the validation error keeps saying in error that the format is wrong  and I should use &#34;mm-dd-yyyy&#34;!&#60;/p&#62;
&#60;p&#62;I tried to change the dateFormat to in other ways (ex. dd/mm/yy), the field content is correctly  printed as I tell in dateFormat option, but the validation field does not change the error and keeps saying that I shoudl use &#34;mm-dd-yyyy&#34; format &#60;/p&#62;
&#60;p&#62;do I need to customize even field validation fuction in some way?&#60;/p&#62;
&#60;p&#62;----------------------&#60;/p&#62;
&#60;p&#62;UPDATE 2: I confirm that the problem is about dateFormat definition.&#60;br /&#62;
I've just commented the line where I define the dateformat, and everything is working... but why?&#60;/p&#62;
&#60;p&#62;I really need o switch month and day place in dateFormat for localization purpose, any suggestions?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>bluantinoo on "Custom configured datepicker not passing the validation"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/custom-configured-datepicker-not-passing-the-validation#post-188891</link>
			<pubDate>Fri, 29 Mar 2013 05:18:00 +0000</pubDate>
			<dc:creator>bluantinoo</dc:creator>
			<guid isPermaLink="false">188891@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Hello,&#60;br /&#62;
I've customized the datepicker configuration to allow just future dates, no weekends or holidays.&#60;/p&#62;
&#60;p&#62;The configuration seeems to work fine, and you can have a look at the form here:&#60;br /&#62;
&#60;a href=&#34;http://www.teloaggiusto.io/riparazione-iphone/iphone-4/&#34; rel=&#34;nofollow&#34;&#62;http://www.teloaggiusto.io/riparazione-iphone/iphone-4/&#60;/a&#62;&#60;br /&#62;
datepicker is in the second page of this multi-page form, at the beginning of the page.&#60;br /&#62;
It's under a conditional logic: to see it you have to change the very first radio button to &#34;Voglio fissare un'altra data&#34;.&#60;/p&#62;
&#60;p&#62;As you can see the calendar widget is working fine:&#60;br /&#62;
you can select just future days, and no weekends or holidays.&#60;/p&#62;
&#60;p&#62;BUT for some reason I cannot figure out, if I try to choose a future date that is more than 15 days in the future, &#60;u&#62;it won't pass the validation&#60;/u&#62;, it display the error as the field it's left empty.&#60;/p&#62;
&#60;p&#62;I'll paste here the code I use:&#60;/p&#62;
&#60;p&#62;1) in functions.php of my template I have this:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;add_action(&#38;#39;wp_enqueue_scripts&#38;#39;, &#38;#39;enqueue_daterestrict_script&#38;#39;, 10, 2);
function enqueue_daterestrict_script() {
		wp_enqueue_script(&#38;#39;daterestrict_script&#38;#39;, get_stylesheet_directory_uri() . &#38;#39;/js/datepicker-restrictions.js&#38;#39;, array(&#38;#39;jquery&#38;#39;));
}&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;2) then In the datepicker-restrictions.js file I have all this stuff:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;// array of year holidays [month, day]
 natDays = [
        [1, 1], [1, 6], [4, 25], [5, 1], [6, 2], [8, 15], [11, 1], [12, 8], [12, 25], [12, 26]
    ];

    function nationalDays(date) {
        for (i = 0; i &#38;lt; natDays.length; i++) {
            if (date.getMonth() == natDays[i][0] - 1
            &#38;amp;&#38;amp; date.getDate() == natDays[i][1]) {
                return [false, natDays[i][2] + &#38;#39;_day&#38;#39;];
            }
        }
        return [true, &#38;#39;&#38;#39;];
    }

    function noWeekendsOrHolidays(date) {
        var noWeekend = $.datepicker.noWeekends(date);
        if (noWeekend[0]) {
            return nationalDays(date);
        } else {
            return noWeekend;
        }
    }

jQuery(document).bind(&#38;#39;gform_post_render&#38;#39;, function(){
if (jQuery(&#38;quot;.datepicker&#38;quot;).length &#38;gt; 0){
    // destroy default Gravity Form datepicker
    jQuery(&#38;quot;.datepicker&#38;quot;).datepicker(&#38;#39;destroy&#38;#39;);
    // create new custom datepicker
    jQuery(&#38;quot;.datepicker&#38;quot;).datepicker({
        // Here I customize language of week days and months labels
	dayNames: [&#38;quot;Domenica&#38;quot;, &#38;quot;Lunedì&#38;quot;, &#38;quot;Martedì&#38;quot;, &#38;quot;Mercoledì&#38;quot;, &#38;quot;Giovedì&#38;quot;, &#38;quot;Venerdì&#38;quot;, &#38;quot;Sabato&#38;quot;],
        dayNamesMin: [&#38;quot;Do&#38;quot;, &#38;quot;Lu&#38;quot;, &#38;quot;Ma&#38;quot;, &#38;quot;Me&#38;quot;, &#38;quot;Gi&#38;quot;, &#38;quot;Ve&#38;quot;, &#38;quot;Sa&#38;quot;],
        monthNames: [&#38;quot;Gennaio&#38;quot;,&#38;quot;Febbraio&#38;quot;,&#38;quot;Marzo&#38;quot;,&#38;quot;Aprile&#38;quot;,&#38;quot;Maggio&#38;quot;,&#38;quot;Giugno&#38;quot;,&#38;quot;Luglio&#38;quot;,&#38;quot;Agosto&#38;quot;,&#38;quot;Settembre&#38;quot;,&#38;quot;Ottobre&#38;quot;,&#38;quot;Novembre&#38;quot;,&#38;quot;Dicembre&#38;quot;],
		dateFormat: &#38;quot;dd-mm-yy&#38;quot;,
		defaultDate: &#38;#39;+1d&#38;#39;,
		minDate: &#38;#39;+1d&#38;#39;,
		gotoCurrent: true,
		prevText: &#38;#39;&#38;#39;,
		showOn: &#38;#39;both&#38;#39;,
		buttonImage: &#38;#39;http://www.teloaggiusto.io/wp-content/themes/teloaggiustoio/images/calendar_icon.png&#38;#39;,
		buttonImageOnly: true,
		beforeShowDay: noWeekendsOrHolidays

	});
}
});&#60;/code&#62;&#60;/pre&#62;</description>
		</item>

	</channel>
</rss>
