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
<auro-datetime type="date"></auro-datetime>
Basic Time
<auro-datetime type="time"></auro-datetime>
Recommended Use and Version Control
There are two important parts of every Auro component. The class 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.
<custom-datetime type="date"></custom-datetime>