Skip to content

Latest commit

 

History

History
80 lines (50 loc) · 2.77 KB

datetime-button.md

File metadata and controls

80 lines (50 loc) · 2.77 KB
title
ion-datetime-button

import Props from '@ionic-internal/component-api/v8/datetime-button/props.md'; import Events from '@ionic-internal/component-api/v8/datetime-button/events.md'; import Methods from '@ionic-internal/component-api/v8/datetime-button/methods.md'; import Parts from '@ionic-internal/component-api/v8/datetime-button/parts.md'; import CustomProps from '@ionic-internal/component-api/v8/datetime-button/custom-props.mdx'; import Slots from '@ionic-internal/component-api/v8/datetime-button/slots.md';

<title>ion-datetime-button: Ionic Input for Datetime Picker</title>

import EncapsulationPill from '@components/page/api/EncapsulationPill';

Datetime 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.

Overview

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.

Basic Usage

import Basic from '@site/static/usage/v8/datetime-button/basic/index.md';

Localization

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.

Format Options

You can customize the format of the date and time in a Datetime Button by providing formatOptions on the associated Datetime instance. See Datetime Format Options for more details.

import FormatOptions from '@site/static/usage/v8/datetime-button/format-options/index.md';

Usage with Modals and Popovers

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.

Properties

Events

Methods

CSS Shadow Parts

CSS Custom Properties

Slots