analog-clock
DefinitelyTyped icon, indicating that this package has TypeScript declarations provided by the separate @types/analog-clock package

1.0.0 • Public • Published

<analog-clock>

An analog clock component written in plain JavaScript:

screen shot 2018-12-12 at 6 00 19 pm

Usage

Basic usage with local time:

<analog-clock></analog-clock>

Providing a time attribute will set the exact time and not update the clock.

<analog-clock time="1301757851000"></analog-clock>

Providing an offset sets the time zone offset. The following sets the time in New York:

<analog-clock offset="-5"></analog-clock>

JavaScript

Anything you can do in HTML with attributes can also be done using the JavaScript API with properties:

import { AnalogClock } from './path/to/clock.js';
 
let clock = new AnalogClock();
clock.offset = -6;
 
document.body.appendChild(clock);

License

BSD-2-Clause

Readme

Keywords

none

Package Sidebar

Install

npm i analog-clock

Weekly Downloads

21

Version

1.0.0

License

ISC

Unpacked Size

15.8 kB

Total Files

4

Last publish

Collaborators

  • samccone