Calendar
An interactive calendar for date selection experiences.Neutral selected states
When the platform-dst-tokens-finesse feature flag is enabled, this component uses the new neutral treatment for selected states.
Installation
| Install | yarn add @atlaskit/calendar |
|---|---|
| Source | Bitbucket.org, (opens new window) |
| npm | @atlaskit/calendar, (opens new window) |
| Bundle | unpkg.com, (opens new window) |
Props
| Description | Additional information to be included in the |
|---|---|
| Type | { [x: string]: any; } |
| Description | Class name to apply to the calendar. |
|---|---|
| Type | string |
| Description | You should not be accessing this prop under any circumstances.
It is provided by |
|---|---|
| Type | (payload: AnalyticsEventPayload) => UIAnalyticsEvent |
| Description | The number of the day currently focused. Places border around the date. Enter |
|---|---|
| Type | number |
| Description | Sets the default value for |
|---|---|
| Type | number |
| Description | Sets the default value for |
|---|---|
| Type | number |
| Description | Sets the default value for |
|---|---|
| Type | string[] |
| Description | Sets the default value for |
|---|---|
| Type | string[] |
| Description | Sets the default value for |
|---|---|
| Type | number |
| Description | Takes an array of dates as string in the format 'YYYY-MM-DD'. All dates provided are greyed out and not selectable. |
|---|---|
| Type | string[] |
| Description | A filter function that takes a date string in the format 'YYYY-MM-DD' and returns true if that date should be disabled. |
|---|---|
| Type | (date: string) => boolean |
| Description | BCP 47 language tag (e.g. |
|---|---|
| Type | string |
| Description | The latest enabled date. All dates in the future after this date will be disabled. |
|---|---|
| Type | string |
| Description | The earliest enabled date. All dates in the past before this date will be disabled. |
|---|---|
| Type | string |
| Description | The number of the month (from 1 to 12) which the calendar should be on. |
|---|---|
| Type | number |
| Description | The aria-label attribute associated with the next month arrow, to describe it to assistive technology. |
|---|---|
| Type | string |
| Description | Function which is called when the calendar is no longer focused. |
|---|---|
| Type | (event: FocusEvent<Element, Element>) => void |
| Description | Called when the calendar is navigated. This can be triggered by the keyboard, or by clicking the navigational buttons. The 'interface' property indicates the the direction the calendar was navigated whereas the 'iso' property is a string of the format YYYY-MM-DD. |
|---|---|
| Type | (event: ChangeEvent, analyticsEvent: UIAnalyticsEvent) => void |
| Description | Called when the calendar receives focus. This could be called from a mouse event on the container, or by tabbing into it. |
|---|---|
| Type | (event: FocusEvent<Element, Element>) => void |
| Description | Function called when a day is clicked on. Calls with an object that has a day, month and year property as numbers, representing the date just clicked. It also has an 'iso' property, which is a string of the selected date in the format YYYY-MM-DD. |
|---|---|
| Type | (event: SelectEvent, analyticsEvent: UIAnalyticsEvent) => void |
| Description | Takes an array of dates as string in the format 'YYYY-MM-DD'. All dates provided are given a background color. |
|---|---|
| Type | string[] |
| Description | The aria-label attribute associated with the previous month arrow, to describe it to assistive technology. |
|---|---|
| Type | string |
| Description | No description. |
|---|---|
| Type | ((instance: HTMLDivElement) => void) | RefObject<HTMLDivElement> |
| Description | Takes an array of dates as string in the format 'YYYY-MM-DD'. All dates provided are given a background color. |
|---|---|
| Type | string[] |
| Description | This allows the calendar to automatically set the focus to the current day. The default is false. |
|---|---|
| Type | boolean |
| Description | Style customization to apply to the calendar. |
|---|---|
| Type | CSSProperties |
| Description | Indicates if the calendar can be focused by keyboard or only programmatically. Defaults to "0". |
|---|---|
| Type | 0 | -1 |
| Description | A
|
|---|---|
| Type | string |
| Description | Value of current day, as a string in the format 'YYYY-MM-DD'. |
|---|---|
| Type | string |
| Description | Start day of the week for the calendar. The mapping between numbers and days of the week is as follows:
Defaults to the first day of the week for the given |
|---|---|
| Type | 0 | 1 | 2 | 3 | 4 | 5 | 6 |
| Description | Year to display the calendar for. |
|---|---|
| Type | number |