Date Picker

Visually represent a date and provide consistent means for navigating its parts.

What the Date Picker Component Does

The Date Picker component is like a calendar on your phone but inside your Salesforce. It shows a calendar with the current month and year, and users can click on a day to select it. You can also add buttons or menus to move between months and years quickly. Users can add extra details once a date is picked, like scheduling a task or event. This component is handy whenever users need to choose a date, such as in scheduling tools, forms, or reports.


Changing the Properties

Choosing Selection mode

The Calendar Component can be configured as single, multiple or interval mode. Only one single value can be selected simultaneously with the Single mode. Multiple mode, the user can select multiple dates. With Interval, the user can only select a date range (two dates).

Assigning Value

Adding Disabled or Marked Dates

Array of disabled dates. Array of marked date objects. A maximum of three markers can be displayed on a same date.


Adding Interactions

From the interactions panel, you can create interactions when users select a date or dates depending on the Selection Mode used. For example, you may want to redirect users to another screen or page when they select dates.

Here is a complete list of actions you can add to the Date Picker.


Styling the Date Picker

From the Styles panel, you can customize styling attributes for the Date Picker:

  • Text: to customize the calendar text color.

  • Background: to customize background colors for the Date Picker.

  • Multi Selected Border: to customize styling settings when an interval is selected as a selection mode.

You can find the instructions for styling here.

Examples

Setting
Value

Selection Mode

Interval

Label

My Button Menu

Icon Size

Medium

Menu Alignment

Left


Specifications

Attributes

Name
Type
Description

disabled

Boolean

If true, the Date Picker is disabled.

disabledDates

Date[]

Array of disabled dates.

hideNavigation

Boolean

Specifies if the Date Picker header should be hidden.

markedDates

CalendarMarkedDate[]

Array of marked date objects. A maximum of three markers can be displayed on a same date.

max

Date

Specifies the maximum date, which the Date Picker can show.

min

Date

Specifies the minimum date, which the Date Picker can show.

selectionMode

String

Specifies the selection mode of the calendar. Valid values include single, multiple and interval.

If single, only one date can be selected at a time. If multiple, the user can select multiple dates.

If interval, the user can only select a date range (two dates).

value

Date

The value of the selected date(s).

weekNumber

Boolean

If true, display a week number column.

Events

Name
Description

change

The event fired when the selected date is changed.

Styling Hooks

Name
Description

Text Color

To specify color for dates.

Disabled Text Color

To specify color for disabled dates.

Today Text Color

To specify color for today's date.

Weekdays Text Color

To specify color for weekdays.

Month Text Color

To specify color for month.

Selected Date Text Color

To specify color on selected dates.

Background Color

To specify a background color for the component.

Background Color Hover

To specify a background color for the component on hover.

Today Background Color

To specify a background color for today's date.

Selected Date Background Color

To specify a background color for selected dates.

Multi Selected Border Color

To specify a border color when multi dates are selected.

Multi Selected Border Style

To set a border style when multi dates are selected.

Last updated