1.4.3 • Published 5 years ago

@wanoo21/countdown-time v1.4.3

Weekly downloads
53
License
MIT
Repository
github
Last release
5 years ago

Countdown to any time Web Component

Create a flexible and powerfull countdown to any future dates.

Getting Started

  • Run npm i @wanoo21/countdown-time
  • Add an import to the npm packages import '@wanoo21/countdown-time';
  • Then you can use the element anywhere in your template, JSX, html etc as <countdown-time add="1h 30m"></countdown-time>

Read more about this Countdown Web Component.

Properties

PropertyAttributeDescriptionTypeDefault
addaddAdd more time to current datetime separated by spaces, ex: add="1h 30m"stringundefined
autostartautostartWhether start or not when countdown is ready, if not, you must start it manually.booleanfalse
datetimedatetimeDatetime to countdown, must be a valid datenumber | stringnull
formatformatShowing format, {d} = days, {h} hours, {m} minutes and {s} seconds.string'{h}:{m}:{s}'
utcutcConvert date to UTCbooleanfalse

Events

EventDescriptionType
changeEmit each time when it changes.CustomEvent<void>
expireEmit when countdown expires.CustomEvent<void>
readyEmit when countdown is ready to start.CustomEvent<void>
startedEmit when countdown in started.CustomEvent<void>
stoppedEmit when countdown in stopped.CustomEvent<void>

Methods

getCountDownTime() => Promise<ITimeObject>

Get countdown time as object.

Returns

Type: Promise<ITimeObject>

reDraw() => Promise<void>

Re-Draw manually countdown after changing the 'add' or 'datetime' property

Returns

Type: Promise<void>

restart() => Promise<void>

Restart countdown manually.

Returns

Type: Promise<void>

setAsExpired() => Promise<void>

Set as expired manually, it'll stop and do everything as expired.

Returns

Type: Promise<void>

start() => Promise<number>

Start countdown manually.

Returns

Type: Promise<number>

stop() => void

Stop/Pause countdown manually.

Returns

Type: void


Built with StencilJS

1.4.3

5 years ago

1.4.2

5 years ago

1.4.1

5 years ago

1.4.0

5 years ago

1.2.0

5 years ago

1.1.0

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago