> For the complete documentation index, see [llms.txt](https://docs.avonnicomponents.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.avonnicomponents.com/flow/flow-components/date-time-picker.md). Agents can also search and read this documentation through its [MCP server](https://docs.avonnicomponents.com/~gitbook/mcp).

# Date Time Picker

Let users pick one or several time slots in a Screen Flow, shown as a day, week or month, limited to the dates and hours you make available.

***

## Overview

<figure><img src="https://27923732-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1FUd4apB9YHgCEMUFbVb%2Fuploads%2Fgit-blob-e17a89d3e3259fd3c2b7f1a02a43c6f3a8b223f9%2Fimage%20(68).avif?alt=media" alt="A Date Time Picker showing one day of 30-minute slots" width="375"><figcaption></figcaption></figure>

The Date Time Picker shows bookable time slots on a Screen Flow screen. A new customer picks a 30-minute onboarding call, or a technician picks a visit window.

You decide which slots exist (hours, slot length, available and blocked periods) and how they look. The flow gets the selected slot back as a Date/Time value.

***

## Tutorials

Step-by-step guides on one shared example week are collected in the [Date Time Picker tutorials](https://docs.avonnicomponents.com/flow/tutorials/components/date-time-picker.md).

<table data-view="cards"><thead><tr><th></th><th></th><th data-hidden data-card-cover data-type="files"></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><strong>Block out booked times from Events</strong></td><td>Read an account manager's Salesforce Events and grey out those times in the Date Time Picker, so nobody books a slot that is already taken.</td><td><a href="https://27923732-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1FUd4apB9YHgCEMUFbVb%2Fuploads%2FGfP4H3mWx4id66sfzvaB%2Fdate-time-picker-card-how-to-block-out-times.png?alt=media">date-time-picker-card-how-to-block-out-times.png</a></td><td><a href="https://docs.avonnicomponents.com/flow/tutorials/components/date-time-picker/how-to-block-out-times.md">Block out booked times from Events</a></td></tr><tr><td><strong>Offer only working hours</strong></td><td>Limit the Date Time Picker to 30-minute slots from 9:00 to 17:00, Monday to Friday, so customers never pick a call outside your working hours.</td><td><a href="https://27923732-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1FUd4apB9YHgCEMUFbVb%2Fuploads%2FNHEgFgyth9TfUxJGmcuo%2Fdate-time-picker-card-offer-only-working-hours.png?alt=media">date-time-picker-card-offer-only-working-hours.png</a></td><td><a href="https://docs.avonnicomponents.com/flow/tutorials/components/date-time-picker/offer-only-working-hours.md">Offer only working hours</a></td></tr><tr><td><strong>Build an appointment booking flow</strong></td><td>Build a Screen Flow where a new customer picks a free 30-minute slot and the flow creates the onboarding call as a Salesforce Event.</td><td><a href="https://27923732-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1FUd4apB9YHgCEMUFbVb%2Fuploads%2FcvKNkgaF5NGeXN5gHfbI%2Fdate-time-picker-card-build-an-appointment-booking-flow.png?alt=media">date-time-picker-card-build-an-appointment-booking-flow.png</a></td><td><a href="https://docs.avonnicomponents.com/flow/tutorials/components/date-time-picker/build-an-appointment-booking-flow.md">Build an appointment booking flow</a></td></tr><tr><td><strong>Book several time slots at once</strong></td><td>Let a customer pick several 30-minute slots in one Date Time Picker and create one Salesforce Event per slot with a Loop and a single Create Records.</td><td><a href="https://27923732-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1FUd4apB9YHgCEMUFbVb%2Fuploads%2F7ALyPY1lWEALQlkZFXIz%2Fdate-time-picker-card-book-several-time-slots-at-once.png?alt=media">date-time-picker-card-book-several-time-slots-at-once.png</a></td><td><a href="https://docs.avonnicomponents.com/flow/tutorials/components/date-time-picker/book-several-time-slots-at-once.md">Book several time slots at once</a></td></tr><tr><td><strong>Format dates and time zones</strong></td><td>Show dates, weekdays and slot times the way your users read them, with a 12-hour or 24-hour clock, the right first day of the week and the time zone.</td><td><a href="https://27923732-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1FUd4apB9YHgCEMUFbVb%2Fuploads%2Fgbgp65Gjk20PtlQwSZ6t%2Fdate-time-picker-card-format-dates-and-time-zones.png?alt=media">date-time-picker-card-format-dates-and-time-zones.png</a></td><td><a href="https://docs.avonnicomponents.com/flow/tutorials/components/date-time-picker/format-dates-and-time-zones.md">Format dates and time zones</a></td></tr><tr><td><a href="https://docs.avonnicomponents.com/projects/use-cases/inside-a-flow/book-the-next-appointment.md">Book Appointment Slots in a Salesforce Screen Flow</a></td><td>Build a Salesforce Screen Flow with Avonni Date/Time Picker to show weekly appointment slots, disable breaks and booked times, and save the choice as an Event.</td><td><a href="https://27923732-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1FUd4apB9YHgCEMUFbVb%2Fuploads%2F1os4qtxIYDAAzfDv7QWU%2Ftutorial-book-the-next-appointment.webp?alt=media">tutorial-book-the-next-appointment.webp</a></td><td><a href="https://docs.avonnicomponents.com/projects/use-cases/inside-a-flow/book-the-next-appointment.md">Book Appointment Slots in a Salesforce Screen Flow</a></td></tr><tr><td><a href="https://docs.avonnicomponents.com/projects/use-cases/portals-and-partner-sites/appointment-self-booking-portal.md">Build a Salesforce Portal for Self-Service Appointment Booking</a></td><td>Build a Salesforce Experience Cloud booking page with Avonni Date Time Picker and a screen flow that disables occupied slots and saves an appointment.</td><td><a href="https://27923732-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1FUd4apB9YHgCEMUFbVb%2Fuploads%2F5Sg7EOzTRMxjfc435vYs%2Ftutorial-appointment-self-booking-portal.webp?alt=media">tutorial-appointment-self-booking-portal.webp</a></td><td><a href="https://docs.avonnicomponents.com/projects/use-cases/portals-and-partner-sites/appointment-self-booking-portal.md">Build a Salesforce Portal for Self-Service Appointment Booking</a></td></tr></tbody></table>

***

## Configuration

Add the Date Time Picker to a Screen element, then click it. The **Edit Date Time Picker Component** panel opens with three tabs: **Properties**, **Interactions** and **Style**. The sections below follow the **Properties** tab from top to bottom.

### Properties

**Label** is the text shown above the picker.

**Type** sets how many slots a user can pick. **Radio** (the default) allows one slot. **Checkbox** allows several.

<figure><img src="https://27923732-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1FUd4apB9YHgCEMUFbVb%2Fuploads%2Fgit-blob-d15aeae5a5a4e7fe12dd1e358af8186442c8f503%2F2024-04-15_20-27-25.png?alt=media" alt="The Type setting open on Radio and Checkbox in the Edit Date Time Picker Component panel"><figcaption></figcaption></figure>

**Selected Date Times** pre-selects one or more slots when the screen opens. Each value can be a Date/Time resource or an ISO 8601 string.

**Variant** changes how the slots are laid out:

| Variant             | What the user sees                                    |
| ------------------- | ----------------------------------------------------- |
| **Daily** (default) | The slots of one day.                                 |
| **Weekly**          | Seven days side by side, one column of slots per day. |
| **Monthly**         | A month view.                                         |
| **Inline**          | Another layout of the picker.                         |
| **Timeline**        | The slots placed along a timeline.                    |

On a narrow screen, **Weekly** falls back to the daily layout under 768 px wide, and **Monthly** under 480 px.

**Date Picker Variant** sets how the date picker used to jump to another date appears: **Input** (default) or **Inline**.

**Time Slot Duration** is the length of each slot, as `hh:mm`. The default is `00:30`, for 30-minute slots.

<figure><img src="https://27923732-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1FUd4apB9YHgCEMUFbVb%2Fuploads%2Fgit-blob-9520ea4d29d7616c0846f109abeb18789cbd3050%2F2025-01-31_14-49-54.png?alt=media" alt="A weekly Date Time Picker in the builder with Time Slot Duration set to 00:30"><figcaption></figcaption></figure>

**Default Visible Date** is the date the Next and Previous buttons move from. The picker itself opens on the current date, unless **Selected Date Times** holds a value: it then opens on the first selected slot.

**Field level help** adds a help icon with your text next to the label.

**Required** stops the user from leaving the screen without picking a slot.

**Disabled** shows the picker but users cannot interact with it.

**Display Next Button** shows a button under the slots once the user picks one. It only appears when **Type** is **Radio**. The button does not move the flow on its own: add a **Next Button Click** interaction (see [Interactions](#interactions)).

**Next Button Label** is the text of that button. The default is `Next`.

#### Advanced Options

Click **Advanced Options** at the bottom of the first group of properties to show these settings.

| Setting              | What it does                                                                                                 |
| -------------------- | ------------------------------------------------------------------------------------------------------------ |
| **Show End Time**    | Shows the end time in each slot, not only the start time.                                                    |
| **Show Time Zone**   | Shows the time zone on the picker.                                                                           |
| **Hide Navigation**  | Hides the previous, next and **Today** buttons.                                                              |
| **Hide Date Picker** | Hides the date picker button.                                                                                |
| **Hide Label**       | Hides the label.                                                                                             |
| **Week Start Day**   | The first day of the week. **Default** follows the user's locale; otherwise pick **Sunday** to **Saturday**. |
| **Read Only**        | Shows the selection but users cannot change it.                                                              |

### Visible Dates and Times

This section decides which slots exist and which ones can be picked.

<figure><img src="https://27923732-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1FUd4apB9YHgCEMUFbVb%2Fuploads%2Fgit-blob-1e583ae9d731e4b0f6b43f71fe33e46e65ae3bc4%2F2025-01-31_14-50-52.png?alt=media" alt="The Visible Dates and Times section of the Properties tab"><figcaption></figcaption></figure>

| Setting                  | What it does                                                              |
| ------------------------ | ------------------------------------------------------------------------- |
| **Start Date**           | The earliest date the picker can show.                                    |
| **End Date**             | The latest date the picker can show.                                      |
| **Start Time**           | The first slot of each day. Default `08:00`.                              |
| **End Time**             | The end of the last slot of each day. Default `18:00`.                    |
| **Available Date Times** | Slot start times that are the only ones selectable.                       |
| **Available Intervals**  | Periods (a start and an end Date/Time) that are the only ones selectable. |
| **Disabled Date Times**  | Single slots that cannot be picked.                                       |
| **Disabled Intervals**   | Periods (a start and an end Date/Time) that cannot be picked.             |
| **Show Disabled Dates**  | Shows the disabled dates in the picker.                                   |

When **Available Date Times** or **Available Intervals** has a value, every slot outside them is disabled, and so is every day they do not touch. Both lists add up. **Disabled Date Times** and **Disabled Intervals** are then removed from what is left.

An interval is not a repeating rule. Each item is one period with a start and an end. To offer the same hours every weekday, set **Start Time** and **End Time** for the hours and use intervals for the days. [Offer only working hours](https://docs.avonnicomponents.com/flow/tutorials/components/date-time-picker/offer-only-working-hours.md) shows how.

To pass intervals from your flow, use an **Apex-Defined** collection variable:

* **Available Intervals** takes the Apex class `avcmpbuilder__DateTimePickerAvailableInterval`.
* **Disabled Intervals** takes the Apex class `avcmpbuilder__DateTimePickerDisabledInterval`.
* Both classes have two Date/Time fields: `startDate` and `endDate`.

To block the times already taken in someone's calendar, see [Block out booked times from Events](https://docs.avonnicomponents.com/flow/tutorials/components/date-time-picker/how-to-block-out-times.md).

### Date Format

These settings change how dates are written in the picker header and day columns.

| Setting                 | Options                                                   | Default |
| ----------------------- | --------------------------------------------------------- | ------- |
| **Date Format Year**    | **Numeric**, **2 Digit**                                  | Numeric |
| **Date Format Month**   | **Numeric**, **2 Digit**, **Long**, **Narrow**, **Short** | Numeric |
| **Date Format Weekday** | **Long**, **Narrow**, **Short**                           | Short   |
| **Date Format Day**     | **Numeric**, **2 Digit**                                  | Numeric |

### Time Format

These settings change how slot times are written.

| Setting                 | Options                  | Default             |
| ----------------------- | ------------------------ | ------------------- |
| **Time Format Hour**    | **Numeric**, **2 Digit** | Numeric             |
| **Time Format Minute**  | **Numeric**, **2 Digit** | Numeric             |
| **Time Format Second**  | **Numeric**, **2 Digit** | Numeric             |
| **Time Format Hour 12** | On or off                | Off (24-hour clock) |

[Format dates and time zones](https://docs.avonnicomponents.com/flow/tutorials/components/date-time-picker/format-dates-and-time-zones.md) walks through these settings for users in different countries.

***

## Interactions

[Interactions](https://docs.avonnicomponents.com/flow/component-builder/interactions-panel.md) run an action when the user does something in the picker. Set them on the **Interactions** tab.

| Interaction           | Fires when                                                   | Common use                                                                                                                                  |
| --------------------- | ------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------- |
| **Change**            | The user selects or clears a slot.                           | Refresh another component on the screen, show a toast.                                                                                      |
| **Next Button Click** | The user clicks the button added by **Display Next Button**. | [Flow Navigation](https://docs.avonnicomponents.com/flow/component-builder/interactions-panel/flow-navigation.md) to go to the next screen. |

Inside an interaction, two variables hold the selection: **Date Time: Value** (`{{DateTime.value}}`) and **Date Time: Value Collection** (`{{DateTime.valueCollection}}`).

[Build an appointment booking flow](https://docs.avonnicomponents.com/flow/tutorials/components/date-time-picker/build-an-appointment-booking-flow.md) uses **Next Button Click** end to end.

## Styling

The **Style** tab changes the look of the picker.

{% tabs %}
{% tab title="Margin and Padding" %}

* **Margin**: **Top**, **Right**, **Bottom**, **Left**. Space around the picker.
* **Padding**: **Top**, **Right**, **Bottom**, **Left**. Space between the picker border and its content.
  {% endtab %}

{% tab title="Size" %}

* **Width** and **Height**: the picker size, for example `100%` or `600px`.
* **Min Width** and **Max Width**: limits on the width.
* **Min Height** and **Max height**: limits on the height.
  {% endtab %}

{% tab title="Border" %}

* **Color**, **Size**, **Style**, **Radius**: the border around the picker.
  {% endtab %}

{% tab title="Header" %}

* **Background Color**: the background of the picker header.
  {% endtab %}

{% tab title="Label" %}

* **Color**, **Font Size**, **Font Style**, **Font Weight**: the label text.
* **Horizontal Alignment**: where the label sits.
  {% endtab %}

{% tab title="Button" %}
The slot buttons.

* **Background Color**, **Background Color Disabled**, **Background Color Selected**
* **Text Color**, **Text Color Disabled**, **Text Color Selected**
* **Border Color**, **Border Color Selected**
* **Border Size**, **Border Size Selected**
* **Border Style**, **Border Style Selected**
* **Border Radius**
  {% endtab %}

{% tab title="Next Button" %}
The button added by **Display Next Button**.

* **Background Color**, **Background Color Active**, **Background Color Hover**
* **Text Color**, **Text Color Active**, **Text Color Hover**
* **Border Color**, **Border Color Active**, **Border Color Hover**
* **Border Radius**, **Border Size**
  {% endtab %}

{% tab title="Flow Dialog" %}
This tab appears only when the picker has an [Open Flow Dialog](https://docs.avonnicomponents.com/flow/component-builder/interactions-panel/open-flow-dialog.md) interaction. It styles the dialog that opens.

* **Flow Dialog Header**: **Background**, **Bottom Border Color**, **Bottom Border Size**, **Label Color**, **Label Font Size**, **Label Font Weight**.
* **Flow Dialog Footer**: **Background**, **Top Border Color**, **Top Border Size**.
  {% endtab %}
  {% endtabs %}

## Output Variables

After the screen, the flow can read the selection. In a later element, pick the Date Time Picker component in the resource picker, then the output.

| Output               | Type                 | What it returns                                                    |
| -------------------- | -------------------- | ------------------------------------------------------------------ |
| **Value**            | Date/Time            | The selected slot. When several slots are selected, the first one. |
| **Value Collection** | Date/Time collection | Every selected slot. Use it when **Type** is **Checkbox**.         |

For example, a Create Records element after the screen creates an Event with `StartDateTime` set to the picker's **Value** and `DurationInMinutes` set to `30`.

To create one record per selected slot, loop over **Value Collection**. [Book several time slots at once](https://docs.avonnicomponents.com/flow/tutorials/components/date-time-picker/book-several-time-slots-at-once.md) shows the loop.

### Flow Interaction Output Variables

An [Open Flow Dialog](https://docs.avonnicomponents.com/flow/component-builder/interactions-panel/open-flow-dialog.md) or [Open Flow Panel](https://docs.avonnicomponents.com/flow/component-builder/interactions-panel/open-flow-panel.md) interaction can return values from the flow it launched into generic output slots. See [Flow Interaction Output Variables](https://docs.avonnicomponents.com/flow/component-builder/interactions-panel/flow-interaction-output-variables.md).

## Troubleshooting

<details>

<summary>The Next button does not show</summary>

**Display Next Button** only works when **Type** is **Radio**. With **Checkbox**, the setting is hidden and no button appears.

</details>

<details>

<summary>The Next button shows but nothing happens on click</summary>

The button only fires the **Next Button Click** interaction. Add that interaction on the **Interactions** tab and set it to **Flow Navigation**, moving to the next screen.

</details>

<details>

<summary>Only one slot reaches the flow when users pick several</summary>

**Value** returns the first selected slot. With **Type** set to **Checkbox**, read **Value Collection** instead.

</details>

<details>

<summary>My interval variable does not appear in Available Intervals or Disabled Intervals</summary>

These properties only accept an **Apex-Defined** variable with **Allow multiple values (collection)** checked, using the class `avcmpbuilder__DateTimePickerAvailableInterval` or `avcmpbuilder__DateTimePickerDisabledInterval`. A Date/Time collection does not appear in the list.

</details>

<details>

<summary>The weekly view shows a single day</summary>

Below 768 px wide, **Weekly** switches to the daily layout. Below 480 px, **Monthly** does the same. Widen the screen or use **Daily** on mobile.

</details>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.avonnicomponents.com/flow/flow-components/date-time-picker.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
