GRAVITY PERKS CONDITIONAL LOGIC DATES
What does it do?
Gravity Forms Conditional Logic Dates allows you show or hide fields based on dates and times!
Documentation
- How does it work?
- How do I enable this functionality?
- How do I setup Time-based Conditional Logic?
- How do I setup conditional logic based on the current date?
- How do I apply conditional logic based on the day of the week?
- How do I apply conditional logic based on whether the date is a weekend or weekday?
- Related Articles
GRAVITY PERKS CONDITIONAL LOGIC DATES
How does it work?
This perk allows Date fields to be selected when creating conditional logic rules for your fields (and other places conditional logic is supported). It integrates seamlessly with Gravity Forms’ existing conditional logic UI.
After selecting a Date field, you will select the operator for comparison (i.e. less than, greater than, is or is not) and enter the date value to which the Date field should be compared.GRAVITY PERKS CONDITIONAL LOGIC DATES
GRAVITY PERKS CONDITIONAL LOGIC DATES
Usage Specifics
- Date value must be entered manually using the US date format:
MM/DD/YYYY
.
This field will be displayed if the date selected in the Date field is greater than June 30, 2015
- Supported operators: “is”, “is not”, “greater than”, “less than”.
- Special conditional-logic-only merge tag supported:
{today}
Allows conditional logic to be applied to fields based on whether the selected date is, is not, is greater than or is less than the current date.
This field will be displayed if the selected date is today’s date.
{today}
merge tag supports modifiers for making date comparisons like:- Date is at least 2 weeks away:
{today:+2 weeks}
- Date is no more than 90 days before today:
{today:-90 days}
- Date is at least 2 weeks away:
- Check for a specific day of the week with the
{monday}
,{tuesday}
,{wednesday}
,{thursday}
,{friday}
,{saturday}
,{sunday}
merge tags. - Date Wildcards: If you want to target a specific day of the month, a specific month, or a specific year, you can use the
*
character as a wildcard.
This field will be displayed if the selected date is within the month of June.This field will be displayed if the selected date falls on the 5th day of every month.This field will be displayed if the selected date is within the year of 2018.GRAVITY PERKS CONDITIONAL LOGIC DATES
- Special Δ Current Time option allows you to show or hide fields based on the current time.
How do I enable this functionality?
- Open the form on which you would like to include this functionality.
- Add a datepicker field to your form.
- Add any other field that you want to show conditionally.
- Open the field and click on the Advanced tab
- Click the “Enable Conditional Logic” check box and enter the desire date base logic. (See examples above)
- Save your changes by clicking the “Update Form” button.
How do I setup Time-based Conditional Logic?
We’ve created an article walkthrough here guiding you through every step!
How do I setup conditional logic based on the current date?
- Add a Date field to your form (it will default to the Datepicker date type).
- Name it something like “Today”.
- Open the field settings for this field and navigate to the “Advanced” tab.
- Set {date_mdy} as the default value (this will automatically populate the current date into this field).
- Now you can enable conditional logic on any other field and configure date-based conditions by comparing this field to a date value (see examples above).
Note: If you want to hide the “Today” date field from being visible to the user, you can hide it by add “gf_invisible” to the field’s CSS Class Name setting on the “Appearance” tab.
How do I apply conditional logic based on the day of the week?
We’ll assume you’ve already added a Date field to your form that either will be auto-populated with today’s date (see above) or one in which the user will select a date.
- Open the field settings for the field that should be shown/hidden based on the day of the week and navigate to the “Advanced” tab.
- Enable Conditional Logic.
- Select your Date field from the first drop down.
- Select “is” from the second drop down.
- Enter “{monday}” (or whichever day of the week you would like to check for) in the last input.
Now this field will only be shown (or hidden) if the selected date falls on the specified day of the week.
How do I apply conditional logic based on whether the date is a weekend or weekday?
First, we’ll tackle checking for weekend dates.
- Open the field settings for the field that should be shown/hidden based on the day of the week and navigate to the “Advanced” tab.
- Enable Conditional Logic.
- Select “Any” from the drop down that contains the options “Any” and “All”.
- Select your Date field from the first drop down.
- Select “is” from the second drop down.
- Enter “{saturday}” in the third input.
- Add a new rule by clicking the (+) button at the end of the row and follow steps 4 and 5 again.
- Enter “{sunday}” for the third input on the new condition.
You can follow the same steps to check for a weekday. The only differences are:
- Select “All” from the drop down that contains the options “Any” and “All”.
- Select “is not” from the second drop down of each condition.
Related Articles
- How to Setup Time-based Conditional Logic for Gravity Forms the Easy Way
- How to Setup Early Bird Pricing with Gravity Forms
- Conditionally Display a Field Based on a Recurring Date