Purpose
A controller that displays a clock of the current time.
| Target | Purpose | Default |
|---|
hours (Optional) | The target to display the current hour | - |
minutes (Optional) | The target to display the current minute | - |
seconds (Optional) | The target to display the current second | - |
milliseconds (Optional) | The target to display the current millisecond | - |
| Value | Type | Description | Default |
|---|
- | - | - | - |
Events
| Event | When | Dispatched on | event.detail |
|---|
- | - | - | - |
Side Effects
The controller will set an interval using setInterval.
The frequency of the interval depends on what targets are present. The interval will be as frequent as needed to update the fastest unit that a target is present for. i.e. When milliseconds are present, the interval will be 1ms. When only hours are present, the interval will update every 5 minutes.
Cleans up on disconnect.
How to Use
Specify the targets that you require to display the clock as you would like it.
See the styles.css in the sandbox/demo for how to control the presentation of the clock.