Verdocs - Developer Documentation

Working with date fields

Limit which dates signers can choose, fill dates in for them, record when they signed, and choose how dates look on the signed PDF.

A few settings decide which dates a signer can choose, what's already filled in when they open the envelope, and how the date prints on the signed PDF. Throughout this guide, we'll use three fields from an example insurance application:

[
  {
    "name": "date_of_birth",
    "type": "date",
    "data_key": "applicant.date_of_birth",
    "config": {"type": "date", "max": "today-18y", "format": "MMMM d, yyyy"}
  },
  {
    "name": "effective_date",
    "type": "date",
    "required": true,
    "config": {"type": "date", "allowed": "future", "max": "today+60d", "starts_today": true}
  },
  {
    "name": "signed_on",
    "type": "timestamp",
    "config": {"type": "timestamp", "include_time": false, "format": "MMMM d, yyyy"}
  }
]

The applicant has to be 18 or older, the policy can start any day from today through 60 days out and default to today unless they change it, and the signed PDF records the day they signed. Each of these is part of the field's config, which you set when you create or update a template field (see Formatting text fields for how config works). The Template Builder sets the same options in its Date and Date signed sections.

Limit the dates a signer can choose

allowed covers the common cases: past means today or earlier, and future means today or later. For anything else, min and max set the earliest and latest dates the signer can choose. Each takes a fixed date like "2026-01-01", or "today" moved by a number of days, weeks, months, or years:

LimitMeans
"2026-12-31"That date
"today"The signer's today
"today+30d"30 days after today
"today-2w"Two weeks before today
"today+6m"Six months after today
"today-18y"18 years before today

Limits include the day they name, so allowed: "future" accepts today, and max: "today-18y" accepts someone who turns 18 today. You can combine them, so {"allowed": "past", "min": "2026-01-01"} takes any day this year up to today. Month and year offsets keep a month-end date inside the target month, so on January 31, "today+1m" is February 28. In the Template Builder, Allowed dates offers Any, Past, Future, and Custom, and Custom sets Earliest and Latest.

Today is always the signer's own day, in their own timezone, both in the date picker and when we check the field again as they finish. A signer in Los Angeles at 5 PM on December 2 gets December 2, even though it's already December 3 in UTC.

The date picker won't offer dates outside the limits. A date that's already in the field and falls outside them (usually one you prefilled) shows a short message like "Choose today or later.", and the signer can't finish until they pick a date that fits. Read-only fields are never checked, so a locked date you supplied never blocks anyone.

Relative limits need js-sdk 6.20.0 and web-sdk 6.20.1 or newer. Older versions compare the limit as text, so an embed that hasn't updated refuses every date in a field with a relative min, and ignores a relative max. The Template Builder saves a limit of exactly today as allowed, which every version understands.

Fill in a date

A date field can start out filled in four ways. When more than one applies, the first one in this list wins:

  1. A default in the request's fields entry for that field, when you create the envelope.
  2. The field's data key in prefill_data (see Fill templates from your data).
  3. The template field's own default.
  4. starts_today, which fills in the signer's today when they open the envelope, as long as today is allowed.

Send dates as ISO 8601, like "2026-11-01" (a time is fine and we keep the day as written), or as "11/01/2026". In our example, effective_date starts as today, but a fields entry of {"name": "effective_date", "default": "2026-12-01"} starts it on December 1 instead.

Whichever way it's filled, the signer can change the date unless the field is readonly. In the Template Builder, Starts as sets this to Empty, Today, or A date (the template's default).

Record when someone signed

A timestamp field, called Date signed in the Template Builder, fills itself in when the signer finishes, and nobody can change it. The signed PDF prints the date and time they finished, in their own timezone and with its abbreviation, like 2026-12-02 05:30:00 PM PST. Set include_time: false to print only the date, as signed_on does above. There's nothing to send for a timestamp field, and a {{timestamp:Applicant}} text tag places one in a document (see Tagging dynamic documents).

Choose how dates look

format decides how a date field shows its date to the signer, and how date and timestamp fields print on the signed PDF:

formatPrints
MM/dd/yyyy12/31/2026 (the default for date fields)
dd/MM/yyyy31/12/2026
yyyy-MM-dd2026-12-31 (the default for timestamp fields)
MMMM d, yyyyDecember 31, 2026
d MMMM yyyy31 December 2026

format only changes what people see. A date field's value is always stored as MM/dd/yyyy, so webhooks, the API, and exports read 12/31/2026 whatever the field shows. A timestamp's value is an ISO 8601 time in UTC, like 2026-12-03T01:30:00.000Z.

Check dates in your own code

When your application fills in dates itself, as in a proxied signing flow, send them as MM/dd/yyyy. js-sdk exports the checks signing uses, so you can test a date before you send it:

import {getDateFieldLimits, isFieldValid} from '@verdocs/js-sdk';

// For effective_date on December 2, 2026: {min: '2026-12-02', max: '2027-01-31'}
const {min, max} = getDateFieldLimits(field.config?.type === 'date' ? field.config : null);

const fits = isFieldValid({...field, value: '01/15/2027'}, recipientFields);

getDateFieldLimits returns the earliest and latest days as YYYY-MM-DD, worked out from today where the code runs. Either one is missing when the field doesn't limit it.

Troubleshooting

When a date doesn't come out the way you expect, these are the usual causes, roughly in the order worth checking:

  • A prefilled date didn't appear. Check prefill_result. prefill_data only reads ISO 8601 and MM/dd/yyyy dates, and lists anything else (like 31/12/2026) in errors. A fields entry with a default for the same field also wins over prefill_data.
  • A prefilled date shows a message to the signer. It's outside the field's limits, and prefill_result.format_problems lists it when you send the envelope. With a limit relative to today, a date that fit when you sent the envelope can fall outside it by the time the signer opens it. The signer can pick a new date unless the field is read-only, and strict mode refuses the send up front instead.
  • A default prints exactly as you typed it. We only read ISO 8601 and MM/dd/yyyy, so a default in any other form is kept as sent and ignores the field's format.
  • Signers can't pick any date at all. The field probably has a relative min, like "today-30d", and the embed is on an SDK older than js-sdk 6.20.0 or web-sdk 6.20.1.
  • A date signed is a day off from what you expected. It prints in the signer's timezone, which we take from their browser, so someone in Sydney who finished on their Tuesday morning shows Tuesday even though it was still Monday in New York. When we don't know their timezone, it prints in UTC.

On this page