New Limit Selectable Dates Configuration Based on Other Date Fields
You can now configure a Date gadget to restrict the dates a user can select based on other Date gadgets in the form. For example, preventing a user from selecting an end date that's before a start date or requiring an event date be between a given project start/end date).
Within the Date gadget the Limit selectable dates configuration now has the option of 'Based on a field'. Once selected, you can then add logic that this date gadget must fall between other date gadget fields within the form (plus or minus a certain amount of days):
For example, let's say you have Start and End date gadgets within your form and you want to put in logic to not allow a Start Date to be after the End Date (and vice versa). First, you would set up the configuration as below for the Start Date (notice you would leave the first criteria blank and only fill out the second between criteria):
Second, you would also configure the End Date field to not be before the Start Date (notice you complete the the first between date criteria but leave the second between criteria blank):
Once configured if a Project Start Date is entered then the user cannot select anything before that date in the Project End Date Field (the options will be greyed out). The same would be true if you enter the Project End Date first then the user would not be able to select any date after that date for the Project Start Date.
Note: You don't have to set both between date criteria if you don't need to limit based on a secondary date field; like in this example where we only want to make sure the start date is before the end date (and vice versa) we leave either the first or second section blank. But you could put in both criteria if you want to make sure a date is within two other form date fields (for example, maybe an event date must be within the project start and end date fields).