Skip to main content

ClockController

Purpose​

A controller that displays a clock of the current time.

Actions​

ActionPurpose
--

Targets​

TargetPurposeDefault
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-

Classes​

ClassPurposeDefault
---

Values​

ValueTypeDescriptionDefault
----

Events​

EventWhenDispatched onevent.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.