Date and time
To create a single line input field of the type, date-time - define the value as date_time. The list of attributes passed to the input field type is given below. All the mandatory parameters are indicated with a *.
Attribute Name | Data Type | Description |
type* | String Value should be datetime | The type of input field. Value of the date-time field should be datetime |
placeholder* | String(100) | Sample field value displayed to the user that describes the expected value of the input field. |
name* | String(50) | A unique identifier for the field. Upon form submission, the value defined for the key will be available in the function associated with the form. |
label* | String(50) | Describes the display name for the field. |
hint | String(100) | Provides a brief description of the field's purpose and the expected input. |
value | JSON Object | Describes the date, time and timezone value chosen by the user. You can also specify a default date, time and timezone value as a placeholder. 2.time_zone_id (Optional) Expected format of date_time is yyyy-MM-DDTHH:mm:ss "value": { |
mandatory | Boolean | Defines if the form field is mandatory or not. The default value is false. |
filter | JSON Object Optional | To manage date selections from the date picker, you can specify a date range and limit the selection to specific days of the week. |
Attribute | Type | Description |
from | String | The earliest selectable date-time in the date picker. Allowed format : yyyy-MM-ddTHH:MM . Refer applicable date-time literals |
to | String | The latest selectable date-time in the date picker. Allowed format : yyyy-MM-ddTHH:MM . Refer applicable date-time literals |
allowed_days | Array of Strings | Days of the week that are allowed for selection. Allowed values : monday | tuesday | wednesday | thursday | friday | saturday | sunday |
Syntax for filter object:
filter : {
"from" : $<Date-Time>,
"to" : $<Date-Time>,
"allowed_days" : [ $<"monday" | "tuesday" | "wednesday" | "thursday" | "friday" | "saturday" | "sunday"> ]
}
Note:
The filter object cannot be empty.
At least one of the following keys (from, to, or allowed_days) is required for the filter to take effect.
Syntax
{
"hint": "",
"name": "",
"label": "",
"placeholder": "",
"type": "datetime",
"value": "",
"mandatory":false //boolean, default is set false
}
Code sample
return {
"type":"form",
"title":"Zylker Annual Marathon",
"name":"marathon",
"hint":"Register yourself for the Zylker Annual Marathon!",
"button_label":"Submit",
"inputs":{
{
"label":"Marathon Date",
"name":"date",
"placeholder":"Choose when you'd like to participate.",
"value":{
"date_time":"2025-03-28T09:00",
"time_zone_id":"America/Edmonton"
},
"filter":{
"from":"2025-03-28T09:00",
"to":"2025-05-30T10:00",
"allowed_days":{
"sunday",
"monday",
"tuesday"
}
},
"mandatory":true,
"type":"datetime"
}
},
"action":{
"type":"invoke.function",
"name":"function"
}
};