Socket
Book a DemoInstallSign in
Socket

@wanoo21/countdown-time

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@wanoo21/countdown-time

Create a flexible and powerfull countdown to any future dates.

1.4.3
latest
Source
npmnpm
Version published
Maintainers
1
Created
Source

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 date`numberstring`
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

Keywords

countdown

FAQs

Package last updated on 08 Aug 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.