This page may contain affiliate links. Please read my disclaimer for more information.

Gravity Forms Multi-Date Picker

  |  by Chris Eggleston

Gravity Forms is a powerful form builder, but you might occasionally find some limitations. For example, the date picker field only supports selecting a single date. As a result, if you need the option to select multiple dates, you must add multiple date fields.

I was intrigued by a user’s request for this feature and decided to find a solution.

In this tutorial, I’ll walk you through a custom solution for adding a multi-date picker to a Gravity Forms field in WordPress.

What This Plugin Does

This simple plugin will allow users to select multiple dates in a single input field, displaying the dates in a comma-separated format.

This plugin provides a multi-date picker for Gravity Forms by:

  1. Dynamically adding a jQuery UI date picker to a specified field (single line text field).
  2. Customizing the date picker to allow multiple date selections.
  3. Displaying all selected dates within a single input field as comma-separated values.
  4. Adding a close button to the date picker for user convenience.
  5. The code includes a settings section to easily configure which form and field to target and specify the date format.

Doesn’t Gravity Forms Have a Date Picker?

Gravity Forms provides a built-in date field, but it has some limitations, primarily that it does not support selecting multiple dates in a single input field.

Limitations of the Standard Gravity Forms Date Field

  1. Single Date Selection Only:

The built-in date field in Gravity Forms only allows users to select one date per field. There’s no built-in functionality for choosing multiple dates using the same input.

  1. Adding Multiple Dates to the Input:

Even if you add support to the existing date field (which I tried), it can not collect more than one input and will not save the dates if more than one is selected.

How to Use This Code

Let’s walk through how to add it to your WordPress site.

Step 1: Install The Plugin

Once downloaded, you can install the plugin like any other WordPress plugin from within your WordPress admin by going to Plugins > Add New Plugin > Upload Plugin.

  • Click the Download Plugin button below
  • Go to Plugins > Add New Plugin > Upload Plugin
  • Click Choose File and locate the zip file labeled multidate-picker-gravity-forms-main.zip
  • Click Install Now
  • Click Activate
  • Go to Plugins > Plugin File Editor
  • Select the Multi-Date Picker Field for Gravity Forms in the select field (top right)
  • Click Select
  • In the main plugin file, multidate-picker-gravity-forms.php, make 2 edits
    • Set form_id to your forms ID number
    • Set field_id to your single line text field ID number
  • Click Update File
  • Go to the page your form is embedded on and test the new date picker

Don’t Have the Plugin File Editor?

If you don’t see the Plugin File Editor in your WordPress Plugins menu, you can follow the steps below to edit the plugin files.

  • Click the Download Plugin button below
  • Locate the multidate-picker-gravity-forms-main.zip file and open it
  • Use a text editor to edit the `multidate-picker-gravity-forms.php` file
    • Set form_id to your forms ID number
    • Set field_id to your single line text field ID number
  • Compress the plugin files
  • Go to Plugins > Add New Plugin > Upload Plugin
  • Click Choose File and locate the zip file you edited
  • Click Install Now
  • Click Activate

Editing the Code

In the multidate-picker-gravity-forms.php file, you will need to edit the code adding your form ID and the field ID you want to use as the date picker. The field should be a single line text field.

  • form_id: The ID of the form in Gravity Forms.
  • field_id: The ID of the specific field within the form.
  • date_format: The date format for the picker (e.g., mm/dd/yy).

Example Configuration:

'form_id' => absint(1),
'field_id' => absint(6),
'date_format' => sanitize_text_field('mm/dd/yy'),

Test the Multi-Date Picker

You can not test this in the form preview, the plugin will not run in the admin. You will need to embed this form on a page or use the Gravity Wiz Live Preview add-on in order to properly test this plugin.

  1. Go to the page where the form is embedded.
  2. The target field should now display the multi-date picker calendar icon.
  3. You can click the calendar icon to open the picker and select multiple dates, and they will appear as comma-separated values in the field.

The Wrap Up

This solution is a simple, flexible way to add a multi-date picker to Gravity Forms. It combines custom CSS, JavaScript, and PHP validation to create a seamless user experience for selecting multiple dates within a single line text field.

If you have issues with this code or need help setting it up, please use the comments below.

Photo of author
About the Author
Chris Eggleston
Husband to 1. Father to 4. Grandpa to 1. Gravity Forms enthusiast. As the owner of WP Mantis, I’m on a mission to simplify the WordPress experience for site owners. I try to bring a unique perspective to the Gravity Forms community.

Support Chris - Donate $5

Gravity Wiz Add-Ons

Advertisement

0 0 votes
Article Rating
Subscribe
Notify of
guest
6 Comments
Inline Feedbacks
View all comments
Troy Patterson
Troy Patterson
2 days ago

This looks to be incredibly well written up. I believe that I followed each step correctly, yet the multiple dates are not showing up for me.

I chose to go with a plug-in. I downloaded the plug-in code, opened it in BBEdit. I changed the form_id to the correct form ID has identified in Gravity Forms page in Dashboard that lists all forms.

I changed the field_id to the field ID of Single Line Text field that I had previously created.

However, I still don’t get the calendar button nor does entering data seem to allow me to pick dates.

The ability to add multiple dates is exactly what I need for a form that I’m working on.

Do I need to make any additional changes in the field settings?

Troy Patterson
Troy Patterson
Reply to  Chris Eggleston
1 day ago

WOW. Thanks so much. The tip about not using preview was crucial.

I’ve installed the new script and I can now pick multiple dates. However, when I go to submit, I’m getting an error. The field ends up being replaced //. The year is getting also getting doubled (05/12/20252025,).

I did try changing line 30

( ‘date_format’ =>sanitize_text_field(‘mm/dd/yy’),

to include a 4 digit year

‘date_format’ => sanitize_text_field(‘mm/dd/yyyy’),

that didn’t make any difference.

The calendar also looks very condensed (screenshot shows view).

Feeling very, very close.

Truly appreciate this plugin.

Screenshot-2025-05-07-at-09.24.24
Troy Patterson
Troy Patterson
Reply to  Chris Eggleston
1 day ago

Thanks again. I did use the new file. I have it working now, and will document what I did (wrong) and the “fix”.

I went back and followed the process once again. (I’m following the instructions on the updated Github page:

  1. Upload the multidate-picker-gravity-forms folder to the /wp-content/plugins/ directory.
  2. Activate the plugin through the ‘Plugins’ menu in WordPress.
  3. Configure the form ID, field ID, and date format in the plugin’s configuration array (see documentation at https://gravityranger.com/gravity-forms-multi-date-picker/).

Steps:

  1. I downloaded the zip file. I uploaded that to my server. I unzipped the file. (I had to move the the folder multidate-picker-gravity-forms-main as it was nested within a folder with the same name).
  2. I updated the form ID (the field id was 6, so no need to change that). I also changed the date format to /yyyy from just /yy. (That is what doubled the year).

‘date_format’ => sanitize_text_field(‘mm/dd/yyyy’),

  1. I have activated the plugin.

Information:

  • The field that I’m using is a Single Date field. (This results in an error. I get the // to start the date.)
  • I changed the field to a Single Line Text field. This results in a successful collection of multiple dates. (The calendar is still really condensed, but it does work).

Additional Information:

  • My ultimate goal is/was to create a calendar with multiple dates. Unfortunately, the GravityCalendar will only pull from date fields.

Thanks again so much for your work with this plugin and the awesome responses.