Skip to product menu
Skip to main content

Date and time 

To create an input field of the type, date-time - define the value as datetime. The list of attributes passed to the input field type is given below.  

Attribute NameDatatype Description
type*String 
(Value should be datetime)
The type of the input field. Value of the field should be datetime.
placeholder*String(150)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, value defined for this key will be available in the function associated with the form.
label*String (150)Describes the display name for this field.
hintString (100)Provides a brief description of the fields purpose and the expected input.
valueObject

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 datetime is YYYY-MM-DDTHH:MM
For example: 

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

mandatoryBooleanDefines if the field's requisite is mandatory or not. 
Note: Default value is considered to be false.
disabledBooleanIf disabled is true, then the field will not be editable

Sample Code:

Copied{
   "type":"datetime",
   "name":"DateTime",
   "label":"Date and Time",
   "placeholder":"Date and Time",
   "hint":"Date and Timezone",
   "mandatory":false,
   "value":{
      "date_time":"2020-04-30T20:30",
      "time_zone_id":"Africa/Lome"
   },
   "disabled" : true
}

JSON format passed in handlers for the filled-in value:

Copied{
   "meta":{
      "type":"datetime",
      "value": {"date_time":"2020-04-30T20:30","time_zone_id":"Africa/Lome"}
   },
   "value":{
      "date_time":"2020-04-30T20:30",
      "time_zone_id":"Africa/Lome"
   }
}