shadowDatetime Button links with a Datetime component to display the formatted date and time. It also provides buttons to present the datetime in a modal, popover, and more.
Datetime Button should be used when space is constrained. This component displays buttons which show the current date and time values. When the buttons are tapped, the date or time pickers open in the overlay.
When using Datetime Button with a JavaScript framework such as Angular, React, or Vue be sure to use the keepContentsMounted property on ion-modal or the keepContentsMounted property on ion-popover. This allows the linked datetime instance to be mounted even if the overlay has not been presented yet.
The localized text on ion-datetime-button
is determined by the locale
property on the associated ion-datetime
instance. See Datetime Localization for more details.
ion-datetime-button
must be associated with a mounted ion-datetime
instance. As a result, Inline Modals and Inline Popovers with the keepContentsMounted
property set to true
must be used.
Description | The color to use from your application's color palette. Default options are: "primary" , "secondary" , "tertiary" , "success" , "warning" , "danger" , "light" , "medium" , and "dark" . For more information on colors, see theming. |
Attribute | color |
Type | "danger" | "dark" | "light" | "medium" | "primary" | "secondary" | "success" | "tertiary" | "warning" | string & Record<never, never> | undefined |
Default | 'primary' |
Description | The ID of the ion-datetime instance associated with the datetime button. |
Attribute | datetime |
Type | string | undefined |
Default | undefined |
Description | true の場合、ユーザはボタンと対話することができません。 |
Attribute | disabled |
Type | boolean |
Default | false |
Description | modeは、どのプラットフォームのスタイルを使用するかを決定します。 |
Attribute | mode |
Type | "ios" | "md" |
Default | undefined |
No events available for this component.
No public methods available for this component.
Name | Description |
---|
native | slotされたテキストをラップするネイティブHTMLボタンです。 |
No CSS custom properties available for this component.
Name | Description |
---|
date-target | 日付ボタンの内側に表示されるコンテンツです。 |
time-target | 時刻ボタンの内側に表示される内容。 |