How to restrict calendar pickers to only allow future / past dates

When creating Digioh forms that include a date picker, you may want to limit users to only be able to select from future or past dates. There’s an app for that! To configure the app, follow the below steps. Please note: Only the Calendar-type date picker is supported by this app.

1. Install the app by going to Custom JavaScript (Apps) under the Account dropdown:

2. In the box, select the Custom field using the Date Picker (calendar) type field that you wish to restrict.

3. Add Field Metadata to the field:

To restrict the date picker to only allow future dates, use the metadata enable_future_date = true:

To restrict the date picker to only allow past dates, use the metadata enable_past_date = true:

If you also want to restrict users from being able to select the current date, use the metadata restrict_current_date = true:

And that’s it! Users will now only be able to select from the configured date range.

 

Any questions? Feel free to reach out to our support team via support@digioh.com!