Trip Interface Description 1.2.2 Help

Date Time

A question of type date_time allows the user to pick a date and/or time.

{ "description": "Both date & time without a default value", "id": 0, "key": "date_time_picker", "label": "Date & Time", "required": true, "type": "date_time", "answers": [ { "id": 0, "nextQuestionId": -1, "options": { "usePicker": true } } ] }

Answer Options

This chapter describes the option possibilities for an answer.

Name

Type

Description

Required

Default

pickDate

bool

Determines if the user has to pick a date.

false

true

pickTime

bool

Determines if the user has to pick a time.

false

true

usePicker

bool

Determines if a picker is used to select the date and time.

false

true

allowSelectFuture

bool

Determines if the user can select a date in the future.

false

true

allowSelectPast

bool

Determines if the user can select a date in the past.

false

true

maxDifference

int

Determines the maximum difference between the current time and the answer.

Note: Use -1 to disable this option.

false

-1

defaultValue

date_time

The default value of the question.

false

The current date and time

Examples

Date time with picker

An example image for question date time
{ "id": 0, "key": "date_time_now", "label": "Date & Time (now)", "description": "Both date & time without a default value with now as default value", "isEnabled": true, "required": true, "type": "date_time", "answers": [ { "id": 0, "label": null, "nextQuestionId": -1, "value": null, "options": { "defaultDateValue": "now", "defaultTimeValue": "now", "usePicker": false } } ] }

Date time with no picker with now as default value

An example image for question date time
{ "id": 0, "key": "date_time_now", "label": "Date & Time (now)", "description": "Both date & time without a default value with now as default value", "isEnabled": true, "required": true, "type": "date_time", "answers": [ { "id": 0, "label": null, "nextQuestionId": -1, "value": null, "options": { "defaultDateValue": "now", "defaultTimeValue": "now", "usePicker": false } } ] }

Date time with a picker and configured max difference

An example image for question date time
{ "id": 0, "key": "date_time_max_diff_picker", "label": "Date & Time (max diff)", "description": "Both date & time. Maximum difference with now is 30 minutes", "isEnabled": true, "required": true, "type": "date_time", "answers": [ { "id": 0, "label": null, "nextQuestionId": 1, "options": { "usePicker": true, "maxDifference": 30 } } ] }

Date time with a picker and current date as default

An example image for question date time
{ "id": 0, "key": "date_time_now_picker", "label": "Date & Time (now)", "description": "Both date & time without a default value with now as default value", "isEnabled": true, "required": true, "type": "date_time", "answers": [ { "id": 0, "label": null, "nextQuestionId": -1, "value": null, "options": { "defaultDateValue": "now", "defaultTimeValue": "now", "usePicker": true } } ] }
Last modified: 05 June 2025