Calendar

This input property is used to fetch the date and time inputs from the visitors, the visitor can choose a specific date and time with this card.

AttributeMandatoryDescriptionValues
typeYesThe type of the input to be displayed to the visitorcalendar
timeNoYou can specify that either the calendar should display only the date or time along with the date.true - To allow the visitor to choose the time value along with the Date 
fromNoYou can specify the Minimum date range from where the visitor are allowed to choose the date ie., the onset date the visitor are allowed to select from the calendar.+/- IntegerThe no. of days to be specified in the calendar will be calculated before and after the present-day.

For Example:

+5 - This will calculate 5 days after the present-day
-3 - This will calculate days before the present-day

Long The date value is specified in milliseconds

For Example:

123232323 - start date / time specified in the calendar
121212133 - end date / time specified in the calendar

toNoYou can specify the Maximum date range from where the visitor are allowed to choose the date ie., the latest date the visitor are allowed to select from the calendar.+/- IntegerThe no. of days to be specified in the calendar will be calculated before and after the present-day.

For Example:

 

+5 - This will calculate 5 days after the present-day
-3 - This will calculate days before the present-day

Long The date value is specified in milliseconds

For Example:

123232323 - start date / time specified in the calendar
121212133 - end date / time specified in the calendar

tzNoYou can specify to allow the visitor to choose the timezone in the calendartrue - To allow the visitor to choose the timezone in the calendar. It defaults the timezone of the visitor's device.
select_labelNoTo set customized text for widget values/slot submission actions

Instead of 'Schedule' they can use custom text like 'Choose a slot"

Note: Maximum character limit for values passed inside the select_label key is 20

Use Cases:

SalesIQ Scripts:

Case 1: Time limit is relative. The date range from where the visitor can choose a date is calculated by +/- integer from the present-day.


{
  "type": "calendar",
  "time": true,
  "tz": true,
  "from": "-5",
  "label": "Schedule a meeting",
  "to": "+5",
  "select_label": "Choose a slot"
}

Case 2: Time limit is absolute. The date range (fromtime to totime)is calculated in the millisecond and the visitor can pick the date from the ample calendar.


{
  "type": "calendar",
  "time": true,
  "tz": true,
  "from": "12121212",
  "label": "Schedule a meeting",
  "to": "1212121",      
  "select_label": "Choose a slot"

Dialogflow:


"platform": "ZOHOSALESIQ",
  "replies": [
      "Choose a date"
    ],
  "input": {
    "type": "calendar",
    "label": "Schedule a meeting",
    "from": "-5",
    "to": "+5",
    "time": true,
    "tz": true,
    "select_label": "Choose a slot"
  }
}

Watson Assistant:


"user_defined": {
  "zohosalesiq": {
    "replies": [
      "Choose a date"
    ],
    "input": {
      "type": "calendar",
      "to": "+5",
      "tz": true,
      "from": "-5",
      "time": true,
      "label": "Schedule a meeting",
      "select_label": "Choose a slot"
    }
  }
}

Zia Skills:

Context Handler function:


result = Map();
response = Map();
response.put("action", "reply");
response.put("replies", [
    "Choose a date"
]);
response.put("input", {
    "type": "calendar",
    "time": true,
    "tz": true,
    "from": "-5",
    "label": "Schedule a meeting",
    "to": "+5",
    "select_label": "Choose a slot"
});
prompt = Map();
prompt.put("param_name", "Calendar");
prompt.put("data", response);
result.put("prompt", prompt);
result.put("todo", "prompt");
return result;

Output: