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.

Limit dates when using date picker field?

  1. Is there a way to only show predefined dates when using the date picker field? I would like to use this to let the users pick between certain available dates.

    Posted 11 years ago on Wednesday November 7, 2012 | Permalink
  2. David Peralty

    We use the JQuery Datepicker plugin, and as such, you are limited to the features of that specific tool. It doesn't allow you to easily block out dates. Check out more details and documentation here:

    http://jqueryui.com/datepicker/

    Posted 11 years ago on Wednesday November 7, 2012 | Permalink
  3. sammet
    Member

    Hi everybody!

    Any updates on this? I also would like to let the users pick between certain available dates.

    Best regards
    Sammet

    Posted 11 years ago on Wednesday March 6, 2013 | Permalink
  4. There are no updates to this functionality.

    Posted 11 years ago on Sunday March 10, 2013 | Permalink
  5. Heya - I'm looking for this too. Specifically to be able to block any dates prior to Today from being selected. I see in the Datepicker documentation that there are minDate and maxDate options...any idea of how to integrate these either through the form or through functions.php?

    cheers,
    -jennyb

    Posted 11 years ago on Monday March 25, 2013 | Permalink
  6. David Peralty

    Actually, you would use JavaScript in your theme's header.php or custom JS location to add in JavaScript from the examples they have listed on their page.

    For example

    <script>
      $(function() {
        $( "#datepicker" ).datepicker({ minDate: -20, maxDate: "+1M +10D" });
      });
      </script>

    The above code would go in your header.php theme file before the </head> and would allow you to select a range of 20 days before and one month and ten days after today.

    http://jqueryui.com/datepicker/#min-max

    Posted 11 years ago on Monday March 25, 2013 | Permalink
  7. Yes, just found this post http://www.gravityhelp.com/forums/topic/calendar-does-the-date-picker-still-allow-users-to-pick-dates-in-the-past

    And it works great! Am now wondering if there is a way to block the field? Because I notice that we have users who are able to enter non-sensical data - I'd like to be able to force them to use the calendar to eliminate possible error...ideas?

    (sorry for the double post!)
    -jennyb

    Posted 11 years ago on Monday March 25, 2013 | Permalink
  8. Just found this...too bad he didn't share his code, would've been helpful! :)
    http://www.gravityhelp.com/forums/topic/value-control-after-submit

    Posted 11 years ago on Monday March 25, 2013 | Permalink
  9. Did you still need help with something here? I thought we took care of the problem over here: http://www.gravityhelp.com/forums/topic/calendar-does-the-date-picker-still-allow-users-to-pick-dates-in-the-past#post-184133

    Please let me know if I can close this topic.

    Posted 11 years ago on Monday March 25, 2013 | Permalink