Sale
Gravity Forms Date Time Calculator
Use Date and Time fields in your Gravity Forms calculations. Perform advanced date and time calculation with ease.
Rs4,838.00 Original price was: Rs4,838.00.Rs410.00Current price is: Rs410.00. for 1 year
This plugin adds the ability to use Date and Time fields in Gravity Forms calculations. Create complex and precise calculations based on any combination of Date, Time, and Number fields. Calculations can be used in any field that normally supports calculations, allowing you to build forms with flexible time-based pricing, track days and hours, determine the age of a customer based on their birth date, and any other calculation related to date and time.
After installing and activating Gravity Forms Date Time Calculator, calculations based on Date and Time fields become available in Number fields within your form. Let’s step through that process.
Add two Date or Time fields to your form. | |
Add a Number field to your form and check Enable Calculation. | |
Insert Date or Time field merge tags into your calculation. |
Now that you know how to create Date-based calculations, let’s dig into the specifics of what Date Time Calculator can do.
In fields that support calculations, like Number and Product fields, the Insert Merge Tag drop down is automatically populated with any Date or Time fields in the form.
Date Time Calculator fully supports Gravity Forms Rounding. If you are looking to round by increments, we have an awesome snippet called Rounding by Increments with Gravity Forms. Super helpful when trying to round up, down or setting a min/max.
Set the calculation unit for the current field. Use this to change the value output on the front end. This also affects how things are calculated on the back end, which is especially useful when working with modifier fields.
Dates are calculated just like any Number. Insert the merge tags for the Date fields into the Formula box with mathematical operators and it will take care of the rest. To count the number of days between two Date fields, simply subtract one field from the other.
Use the {weekdays:}
and {weekendDays:}
merge tags to count the number of weekdays or weekend days between two dates. Use the following syntax:
{weekdays:{FIELD_LABEL:FIELD_ID},{FIELD_LABEL_:FIELD_ID}}
For example, if we have two date fields labeled “Start Date” and “End Date” with Field IDs of 1 and 2 respectively, use the following merge tag to count the number of weekdays between the two dates.
{weekdays:{Start Date:1},{End Date:2}}
-1
to your calculation after the merge tag.Calculations between Time fields behaves mostly the same as Date fields. Insert the merge tags into a Number field and Date Time Calculator will perform any mathematical operations you tell it to.
You can combine Date and Time fields to create combined calculations. This lets you create more precise calculations all the way down to the second. In the following example, we’ll count the number of hours between two dates with specific times.
Date Time Calculator supports user modified date calculations by including additional Number fields in the calculation. In the following example, we’ll count the number of days between two dates and add a user-defined amount of days to the result.
{Date:2} - {Date:1} + {Modifier:4}
On the front end, the user can select the Start and End Dates, input a modifier in the Modifier field, and the result will add the number of days in the Modifier field to the result.
Calculating age is simple with Date Time Calculator. To calculate age from a Date field, add the :age merge tag modifier to the desired Date field merge tag using the following template:
{FIELD_LABEL:FIELD_ID:age}
For example, for a field labeled “Date of Birth” with a field ID of “1”, the merge tag is written like this:
{Date of Birth:1:age}
Use the {today}
merge tag to make calculations based on the current date. For example, to count the number of days between now and a user-inputted date, use the following syntax:
{Date:1} - {today}
The same can be done with Time fields and the {now}
merge tag.
{Time:1} - {now}
Both of these merge tags are automatically recalculated on submission to maintain accuracy. If your form relies on up-to-the-second time, we have you covered.
Date Time Calculator integrates seamlessly with Gravity Forms Advanced Calculations. GP Advanced Calculations allows for complex functions, formulas, conditionals, and more directly in your Number and Product fields. These two perks can also be used together to calculate durations.
You can use the free Loco Translate plugin to create translations for any of our Perks. If you’ve never used Loco translate before, here’s a tutorial written for beginners.
Use this snippet to disable autocomplete for your forms.
If you’re calculating the difference between a day in Daylight Savings Time and a day in Standard Time, a whole number will not be returned since there is a missing or extra hour in the calculation.
To return a whole number, set the Rounding setting to 0 on your Number field.
When using any Date Time Calculator merge tags, the Validate Formula button may display a message stating that the formula is invalid.
We recommend using GP Advanced Calculations – it offers a more robust functionality for calculating and validating formulas.
No account yet?
Create an Account