new Clock()
Creates an object used for refreshing the clock UI element.
Creates an object used for refreshing the clock UI element. Handles all related timer manipulation (start/stop/cancel).
- Source:
Members
(static) this.timeoutID
One-shot timer used to refresh the clock at a minute's turn
.One-shot timer used to refresh the clock at a minute's turn
- Source:
(static) this.timeoutID
One-shot timer used to refresh the clock at a minute's turn
.One-shot timer used to refresh the clock at a minute's turn
- Source:
(static) this.timerID
Timer used to refresh the clock every minute
.Timer used to refresh the clock every minute
- Source:
(static) this.timerID
Timer used to refresh the clock every minute
.Timer used to refresh the clock every minute
- Source:
Methods
(static) this.start(refresh)
Start the timer used to refresh the clock, will call the specified callback at every timer tick to refresh the UI.
Start the timer used to refresh the clock, will call the specified callback at every timer tick to refresh the UI. The callback used to refresh the UI will also be called immediately to ensure the UI is consistent.
Parameters:
Name | Type | Description |
---|---|---|
refresh |
function | Function used to refresh the UI at every timer tick, should accept a date object as its only argument. |
- Source:
(static) this.start(refresh)
Start the timer used to refresh the clock, will call the specified callback at every timer tick to refresh the UI.
Start the timer used to refresh the clock, will call the specified callback at every timer tick to refresh the UI. The callback used to refresh the UI will also be called immediately to ensure the UI is consistent.
Parameters:
Name | Type | Description |
---|---|---|
refresh |
function | Function used to refresh the UI at every timer tick, should accept a date object as its only argument. |
- Source:
(static) this.stop()
Stops the timer used to refresh the clock
.Stops the timer used to refresh the clock
- Source:
(static) this.stop()
Stops the timer used to refresh the clock
.Stops the timer used to refresh the clock
- Source: