🎉 Celebrate with 10% OFF on All Products! Use Code: GFEX10 Or Buy Any 2+ Items for 30% OFF with Code: GFEX30!

Gravity Forms Duration Field Setup Guide

Updated 4 min read Gravity Forms Fields & Inputs
On this page
  1. Video walkthrough
  2. What you need
  3. Activate the add-on
  4. Add the field and choose how it asks
  5. What the visitor sees
  6. The minimum, maximum and step you can rely on
  7. Stored as minutes, shown in a friendly form
  8. Merge-tag modifiers
  9. A duration, not a clock time
  10. Privacy and data

Video walkthrough

Gravity Forms Duration Field Setup Guide: Hours & Minutes with Min, Max & Step
Video setup guide: Gravity Forms Duration Field Watch on YouTube

The Gravity Forms Duration Field add-on adds a field for a length of time — how long something is, such as 2h 30m or 1d 4h — which is different from the core Time field (a clock time of day). A visitor types the parts (hours and minutes, days / hours / minutes, or a single number in a unit you choose) and the add-on stores the value as a whole number of minutes, so it sorts, filters and feeds calculations, and shows it in a friendly form everywhere. This guide covers turning it on, adding the field, the input styles, the minimum / maximum / step, and the merge-tag modifiers.

What you need

You need Gravity Forms 2.9 or newer and WordPress running PHP 7.4 or newer. There is nothing else to sign up for: the add-on is GravityForms-first, uses no third-party service, needs no API key, and makes no outside HTTP calls. It is handy wherever a form collects an amount of time — a service or appointment length, time logged on a task, estimated effort, cooking or processing times, rental or hire periods, and anything you later want to total or compare.

Activate the add-on

In WordPress go to Forms → Settings → Duration Field and activate your GravityExtra license key. Once it is active you can set the site-wide defaults a new field starts with — the default input style and the default step — which every field can override.

The Duration Field settings page in Gravity Forms: the licence key and the default input style and step for new fields
The settings page: your licence key and the defaults a new Duration field starts with.

Add the field and choose how it asks

Edit a form and add the Duration field from the Advanced Fields group. In the field’s Duration settings choose the input style: hours and minutes (two boxes), days, hours and minutes (three boxes), or a single number and unit (one box with a fixed unit of minutes, hours or days). This is also where you set the minimum, the maximum and the step. The days/hours/minutes style is shown below.

The Duration field in days, hours and minutes mode on a Gravity Form, with a live total preview
The days, hours and minutes input style, with a live total preview.

What the visitor sees

On the page the field shows the part boxes for the style you chose, each labelled with its unit, and — unless you turn it off — a live total preview under the field that updates as the visitor types (for example “Total: 2h 30m”). The visitor only ever types whole numbers; the add-on does the combining.

The Duration field on a Gravity Form, showing hours and minutes boxes with a live total preview
The field on the front end: part boxes with a live total preview.

The minimum, maximum and step you can rely on

A preview in the browser is helpful, but it is not something you can trust on its own — anyone can turn off JavaScript or post to the form directly. That is why the rules are enforced on the server. Set a minimum, a maximum and a step (all in minutes); on submit the add-on combines the parts, rejects an unreadable entry (for example minutes above 59), and fails the field with a clear message when the total is below the minimum, above the maximum, or not a whole multiple of the step. Because this happens on the server, a visitor who skips the browser checks still cannot get an out-of-range duration through.

Stored as minutes, shown in a friendly form

The value is stored as a whole number of minutes, so it behaves like a real number: it sorts and filters correctly in the entries list and can be used in calculations and conditional logic. Everywhere it is shown — the entries list, the entry screen and your notifications — it appears in a friendly form such as “2h 30m” or “1d 4h”.

A Gravity Forms entry screen showing a duration stored as minutes and shown in a friendly form such as 2h 30m
The entry shows the duration in a friendly form; it is stored as minutes underneath.

Merge-tag modifiers

The field’s merge tag (for example {Duration:4}, where 4 is the field id) outputs the friendly form by default. Three modifiers change that when you need a different shape: {Duration:4:minutes} gives the raw number of minutes (handy for calculations or passing to another system), {Duration:4:long} gives “2 hours 30 minutes”, and {Duration:4:colon} gives “2:30”. Use them in notifications, confirmations and routing.

A duration, not a clock time

It is worth being clear about the difference. The core Time field collects a point in the day — 9:00 am. This field collects a length of time — how long something lasts. If you want “how long did this take?” or “how long should we book?”, this is the field; if you want “what time does it start?”, the core Time field is the right one.

Privacy and data

Everything happens on your own site. The add-on contacts no third-party service and makes no outside HTTP request at all, apart from checking gravityextra.com for your licence and plugin updates. The only data it handles is the duration the visitor enters, stored as a plain number of minutes with the entry.

Still need help?

Our support team answers tickets every day, usually within a few hours.

0
0
Your Cart
Your cart is emptyReturn to Shop
🔥 FREQUENTLY BOUGHT TOGETHER
Complete Combo & Save 40%!
ITEM IN YOUR CART
Gravity Forms Klaviyo Add-on
$39.00/yr
+
🎁 RECOMMENDED ADD-ON SAVE 40% OFF
Original Price: $39.00/yr
Bundle Special Price: $23.40/yr