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.

Calendar Widget Date problem

  1. Hey guys, I'll get straight to the point, I'm using a form that has only a date field in the format dd/mm/yyyy and with Jquery's datepicker/calendar. The problem is when I set my code to the following:

    <script type="text/javascript">
    jQuery.noConflict();
      jQuery(document).ready(function($) {
    		$("#input_1_1").datepicker({ minDate: new Date(1982, 1-1, 1), buttonImage: '/wp-content/plugins/gravityforms/images/calendar.png',  hideIfNoPrevNext: true, showOn: 'both', buttonImageOnly: true });
      });
    </script>

    The date range won't go past 2002 using the calendar icon, but you can still set the year between 1982-2001 if you keep on hitting the previous button. Seems like an odd problem but I'm not sure what's causing it.

    Included a picture:
    http://imageshack.us/photo/my-images/440/calendarfa.png/

    Posted 12 years ago on Wednesday January 18, 2012 | Permalink
  2. How about a link to your form online? Sounds like a JavaScript conflict, but we'd have to see it in person.

    Also, does the same thing happen when you try it in the preview? If so, then it is likely your custom code. If it happens in the preview, can you remove the custom code and see if that works? Or does the custom code not run in the preview for this form (if it's in a template file, for example.)

    Posted 12 years ago on Friday January 20, 2012 | Permalink
  3. Hey there Chris.

    Sorry I have this on a localhost, but I have found a solution. If you look at my previous code, just add in yearRange: '-40:0' and it allows you to scroll to the specified minDate. The custom code itself doesn't seem to be a problem because it WORKS, it's just the dropdown menu itself wouldn't go past 2002. I agree there's a conflict somewhere but this work around is a good enough fix for me.

    Cheers.

    Posted 12 years ago on Friday January 20, 2012 | Permalink