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 NameData TypeDescription
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.
hintString(100)Provides a brief description of the field's purpose and the expected input.
valueJSON 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. 
1.date_time (Mandatory) 

2.time_zone_id (Optional)  

Expected format of date_time is yyyy-MM-DDTHH:mm:ss
For example: 

"value": {
"date_time": "2011-12-03T12:15",
"time_zone_id": "Africa/Lome"
}

mandatoryBooleanDefines if the form field is mandatory or not. The default value is false.
filterJSON 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.

The filter object attributes:

AttributeTypeDescription
fromString

The earliest selectable date-time in the date picker.

Allowed format : yyyy-MM-ddTHH:MM . Refer applicable date-time literals

toStringThe latest selectable date-time in the date picker.
Allowed format : yyyy-MM-ddTHH:MM . Refer applicable date-time literals
allowed_daysArray of StringsDays 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"
   }
};