Date picker field

Use the date_picker field when you need a respondent to choose a date. You can set date limits, disable weekdays and choose how the date is shown and stored.

Configuration

These properties are specific to date_picker. See shared field properties for properties that apply across field types.

NameTypeRequiredDefaultDescription
placeholderstringNoNoneText shown on the picker before a date is chosen. Supports {{field}} piping. Not used with M/d or d/M.
defaultValuestringNoNoneDate selected initially, written in the field's format. May be a {{hidden_name}} reference.
minDatestring or nullNoNo earliest dateEarliest selectable date. Use YYYY-MM-DD, today, +Nd or -Nd, where N is 0–3650.
maxDatestring or nullNoNo latest dateLatest selectable date. Accepts the same values as minDate.
disabledWeekdaysinteger[]NoEvery weekday can be pickedWeekdays that cannot be picked: 0 (Sunday) through 6 (Saturday), each at most once, with at most six entries.
formatstringNoMM/dd/yyyyHow the date is shown and stored. Options: MM/dd/yyyy, dd/MM/yyyy, yyyy-MM-dd, M/d or d/M. The last two collect month and day only.

today and relative dates such as +7d are based on the respondent's local date. minDate, maxDate and disabledWeekdays apply only to the three full-date formats, not M/d or d/M.

Validation

  • If the field is required and no date is chosen, the respondent cannot continue.
  • The calendar prevents choosing a date before minDate, after maxDate or on a disabled weekday.
  • A prefilled or restored date outside the limits blocks the page and shows a message naming the limit.
  • The limits are checked again at submission. If the date fails, the submission is rejected and the respondent is asked to pick another date.

Submission value

The answer is a string in the field's format. With M/d or d/M, the value contains only the month and day, without padding. The form checks the date limits in the form and again on the server.

Example

This field accepts dates from today through 90 days from today, excluding weekends, and stores the answer as yyyy-MM-dd.

{ "type": "date_picker", "name": "appointment_date", "label": "Choose an appointment date", "subtext": "Select a weekday within the next 90 days.", "placeholder": "Select a date", "minDate": "today", "maxDate": "+90d", "disabledWeekdays": [0, 6], "format": "yyyy-MM-dd", "required": true }