Date Time Slots for Zia Skills
You can use this card to display the list of date and time slots in the window and allow the visitor to pick one from the given slots.
Attribute | Mandatory | Description | Values |
type | Yes | The type of the input to be displayed to the visitor | date-timeslots |
slots | Yes | You can specify the array of dates in dd/mm/yyyy format and time slots in hh:mm (24 hrs) format that you would like to display. The date and time will be sorted in acending order automatically. | { dd/mm/yyyy : [hh:mm, hh:mm] } |
tz | No | You can specify to allow the visitor to choose the timezone in the calendar | true - To allow the visitor to choose the timezone in the calendar. If not specified, then the timezone of the visitor's device will be taken by default. |
Use Case:
Context Handler function:
Copiedresult = Map();
response = Map();
response.put("action", "reply");
response.put("replies", [
"Choose your convenient date and time:"
]);
response.put("input", {
"type": "date-timeslots",
"tz": true,
"label": "Select a time ",
"slots": {
"24/08/2018": [
"09:00",
"09:30",
"10:00",
"10:30",
"11:00",
"11:30"
]
}
});
prompt = Map();
prompt.put("param_name", "date-timeslots");
prompt.put("data", response);
result.put("prompt", prompt);
result.put("todo", "prompt");
return result;