0.1.6 • Published 1 year ago

clock-widget-ts v0.1.6

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

English | 中文

Introduction

Generate digital clock or dial clock, support time zone, custom style Currently only digital clocks are supported, other types are under development...

Install

Install via NPM/YARN

$ npm install /i clock-widget-ts --save
$ yarn install /i clock-widget-ts --save

API

Object instantiation

import Clock from 'clock-widget-ts'
new Clock(option)

The option object has the following properties

ParameterTypeDefaultDescription
tzStringAmerica/New_Yorktime zone (please refer to https://en.wikipedia.org/wiki/List_of_tz_database_time_zones)
tick.Booleantruewhether to move
styleStringcustom style, such as color, size, etc.
typeStringdigitaldigital pure digital clock, dial dial clock.

Events

event nameparameterdescription
destroydestroy instance

Example usage

import Clock from 'clock-widget-ts'
let myClock = null
let option = {
   tz: 'America/New_York',
   style: 'color:red;width:50px;'
    //...
}
myClock = new Clock(option)

myClock. destroy()

license

This project is authorized under the license of the Massachusetts Institute of Technology (MIT), for details, please click LICENSE file to view.

0.1.3

1 year ago

0.1.6

1 year ago

0.1.5

1 year ago

0.1.2

1 year ago

0.1.1

1 year ago

0.1.0

1 year ago