Date time slots card

This card allows getting date & time as input. It displays the list of date and time slots in the window and allows the visitor to pick one from the given slots.

AttributeMandatoryDescriptionValues
typeYesThe type of input to be displayed to the visitordate-timeslots
labelYesTo set customized title text for the slotsSelect a Time
slotsYesSpecify 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]
  }
tzNoSpecify to allow the visitor to choose the timezone in the calendartrue - 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.
time_zone_idYestime_zone_id from the java.util.TimeZone class is validAsia/Calcutta
Channel compatibility and limitations

     

Facebook Messenger:

  • The card is supported on Facebook. 
  • When using this card, the user would have to type the date/time manually. 

Instagram:

  • The card is supported on Instagram. 
  • When using this card, the user would have to type the date/time manually. 

WhatsApp:

  • The card is supported on WhatsApp. 
  • When using this card, the user would have to type the date/time manually.

Telegram:

  • The card is supported on Telegram. 
  • When using this card, the user would have to type the date/time manually.

 LINE:

  • The card is supported on LINE. 
  • When using this card, the user would have to type the date/time manually.

Output

Use Case

Copied{
  "type": "date-timeslots",
  "tz": true,
  "label": "Select a time ",
  "time_zone_id": "Asia/Calcutta",
  "slots": {
    "24/08/2018": [
      "09:00",
      "09:30",
      "10:00",
      "10:30",
      "11:00",
      "11:30"
    ]
  }
}
Copied//context handler function
result = 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;

//Execution function
result = 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"
    ]
  }
});
result.put("data", response);
return result;
Copied{
  "type": "date-timeslots",
  "tz": true,
  "label": "Select a time ",
  "time_zone_id": "Asia/Calcutta",
  "slots": {
    "24/08/2018": [
      "09:00",
      "09:30",
      "10:00",
      "10:30",
      "11:00",
      "11:30"
    ]
  }
}
Copied{
  "platform": "ZOHOSALESIQ",
  "replies": [
    "Sure, pick the time slot and I will take care of the rest."
  ],
  "input": {
  "type": "date-timeslots",
  "tz": true,
  "label": "Select a time ",
  "time_zone_id": "Asia/Calcutta",
  "slots": {
    "24/08/2018": [
      "09:00",
      "09:30",
      "10:00",
      "10:30",
      "11:00",
      "11:30"
    ]
  }
}
}
Copied"user_defined": {
  "zohosalesiq": {
    "replies": [
      "Sure, pick the time slot and I will take care of the rest."
    ],
    "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"
        ]
      }
    }
  }
}
Copied"channelData":{
        "zohosalesiq": {
            "input": {
  "type": "date-timeslots",
  "tz": true,
  "label": "Select a time ",
  "time_zone_id": "Asia/Calcutta",
  "slots": {
    "24/08/2018": [
      "09:00",
      "09:30",
      "10:00",
      "10:30",
      "11:00",
      "11:30"
    ]
  }
},
            "replies":["Sure, pick the time slot and I will take care of the rest."]
        }
    }