Datetime

The <auro-datetime> custom element makes it really easy to add dates to your web app with a simple HTML API.

auro-datetime use cases

The <auro-datetime> element should be used in situations where users may:

  • A date and/or time is required

Example(s)

Basic Date

See code
<auro-datetime type="date"></auro-datetime>

Basic Time

See code
<auro-datetime type="time"></auro-datetime>
Having a closing statement about your example helps to really complete the thought with your reader.

Recommended Use and Version Control

There are two important parts of every Auro component. The classLink to external site.This indicates a link to an external site that may not follow the same accessibility or privacy policies as Alaska Airlines. By selecting a partner link you agree to share your data with these sites. and the custom element. The class is exported and then used as part of defining the Web Component. When importing this component as described in the install section, the class is imported and the auro-datetime custom element is defined automatically.

To protect from versioning conflicts with other instances of the component being loaded, it is recommended to use our AuroDatetime.register(name) method and pass in a unique name.

import { AuroDatetime } from './src/auro-datetime.js';

AuroDatetime.register('custom-datetime');

This will create a new custom element that you can use in your HTML that will function identically to the auro-datetime element.

See code
<custom-datetime type="date"></custom-datetime>