Index

Clock

new Clock()

Creates an object used for refreshing the clock UI element. Handles all
related timer manipulation (start/stop/cancel).

Members

static this.timeoutID

One-shot timer used to refresh the clock at a minute's turn

static this.timerID

Timer used to refresh the clock every minute

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

static this.stop()

Stops the timer used to refresh the clock