Constructor
new WorldClock($span, tzopt)
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
$span |
jQuerySingleSpan | a jQuery object representing the HTML
|
||
tz |
TimeZoneString |
<optional> |
Europe/London | The timezone for the clock. |
Throws:
-
An error is thrown when an invalid value is passed for any of the arguments.
- Type
- TypeError
Members
(private) _$hours :jQuerySingleSpan
The inner span for the hours.
Type:
(private) _$minutes :jQuerySingleSpan
The inner span for the minutes.
Type:
(private) _$separatorHM :jQuerySingleSpan
The inner span for the separator between the hours and minutes.
Type:
(private) _$span :jQuerySingleSpan
A jQuery object representing the span containing the clock.
Type:
(private) _intervalId :integer
When the clock is running, the ID of the interval controlling it, otherwise, 0.
Type:
- integer
(private) _timezone :TimeZoneString
The clock's timezone as a string.
Type:
Methods
(static) autoInitialise($containersopt)
Initialise all spans with the class pbs-worldclock-auto
within a given
set of containers.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
$containers |
jQueryObject |
<optional> |
$(document) | the container(s) to search for spans to be automatially transformed into clocks. By default the entire document is searched. |
Throws:
-
An error is thrown if the first argument is present, but not a jQuery object.
- Type
- TypeError
start()
Start the clock.
stop()
Stop the clock.
timezone(tzopt) → {TimeZoneString}
Get and/or set the clock's timezone.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
tz |
TimeZoneString |
<optional> |
Throws:
-
An error is thrown if an argument is passed that is not valid.
- Type
- TypeError
Returns:
- Type
- TimeZoneString