Class Details

Class Anclock
Version 1.00.

Anclock(sDivname, aOptions)
analog clock with divs and a digital time.
The hands are created as DIVs and rotated with CSS3.
It can show the users local time or a time based on UTC with offset

PROJECT HOME: http://sourceforge.net/projects/anclock/
DOC: https://www.axel-hahn.de/docs/anclock/index.htm


Author: Axel Hahn.
Version: 1.00.
<div id="myclock"></div>
(...)
<script>
  var oClock=new Anclock("myclock");
</script>
<div id="myclock"></div>
<script>
  var aOptions={...}
  var oClock=new Anclock("myclock", aOptions);
</script>
Parameters:
{string} sDivname
an existing (and empty) DIV
{array} aOptions
optional array with options; hava a look to setOptions to see a description of the option array
Returns:
none
See:
Anclock.setOptions()

Public Methods

getDate

{date object} getDate()

get the date that the clock currently uses/ shows.

Returns:
{date object} date of the clock including offset

getOptions

{array} getOptions()

get current options; see setOptions() for details to the options array

Returns:
{array} aOptions

getSkin

{array} getSkin(sSkin)

get skin styling data - it is taken from skin parameter values and filled with options (values of a sckin override options)

Parameters:
sSkin
Returns:
{array}

getTimeAsString

{string} getTimeAsString()

get the time as HH:MM that the clock currently uses/ shows.

Returns:
{string}

setDate

setDate(oDatetime)

set a time for the clock.

Parameters:
{date} oDatetime
javascript date object for the new time to show;
Without a parameter it sets the current date and time from system clock on the client and adds the offset (if it is set).
Returns:
none

setOptions

setOptions(aOptions)

Apply new options after the clock was initialized.
The same options array can be used at initialisation. See constructor on top.

oClock.setOptions={
        width: false,           // size of the clock
        height: false,

        iAnimate: 0,            // duration for animation of clock hands [s]
        bStopped: false,        // set true to keep the shown time
        
        bShowDay: true,         // show day of the month (as text)
        bShowDigital: true,     // Show digital clock (as text)
        bShowSeconds: false,    // Show seconds in digital clock
        bShowSecHand: true,     // show seconds hand in the analog clock
        bShowTimeAsTitle: true, // use date and time as title
        
        bUseOffset: false,      // use offset no: show users system time; yes: use iOffset to UTC time
        iOffset: 0,             // offset value to UTC in minutes

        skin: 'default',        // name of existing skin
}
Parameters:
{array} aOptions
options array with one, some or all these keys
Returns:
none

Documentation was generated by JsDoc Toolkit 2.4.0






Copyright © 2016-2024 Axel Hahn
project page: Sourceforge (en)
Axels Webseite (de)
results will be here