Documentation

Calendar Component

Calendar Component

The Calendar component allows users to select a date within a specified range. You can customize the behavior of the calendar using the following options:

  • minDate: Defines the earliest date that can be selected. It should be in the ISO 8601 format (YYYY-MM-DD).
  • maxDate: Sets the latest date that can be selected. Also follows the ISO 8601 format.
  • weekdaysOnly: Limits selection to weekdays (Monday through Friday). No weekend dates can be chosen if this is set to true.
  • excludeDates: Prevents specific dates from being selected. Provide an array of dates in the ISO 8601 format.

Example Configuration:

{
  "type": "calendar",
  "payload": {
    "minDate": "2024-07-01",    // Earliest selectable date
    "maxDate": "2024-07-22",    // Latest selectable date
    "excludeDates": ["2024-07-01", "2024-07-02"], // Dates that can't be selected
    "weekdaysOnly": true        // Only weekdays can be selected
  },
  "hideChatInput": true         // Hides chat input while the calendar is active
}

Output:

When a user selects a date, it will be submitted as an array, like this:

["2024-07-19"]