npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

time-to

v1.3.1

Published

Countdown timer and digital clock

Downloads

1,089

Readme

#TimeTo

Note: This package is deprecated and developing is stoped. Use fancy-timer instead.

npm i fancy-timer

jQuery plugin - timer countdown digital clock

Demo

http://lexxus.github.io/jq-timeTo/

Install

npm install time-to

Examples

Countdown timer

Set delay in seconds

$('#countdown').timeTo(100, function(){ alert('Countdown finished'); });

Hide hours

$('#countdown').timeTo({ seconds: 100, displayHours: false });

Set delay to specified datetime

$('#countdown').timeTo(new Date('Dec 10 2013 00:00:00 GMT+0200 (EET)'));

Set captions and dark theme

$('#countdown').timeTo({
    timeTo: new Date(new Date('Dec 10 2013 00:00:00 GMT+0200 (EET)')),
    theme: "black",
    displayCaptions: true
});

Digital clock

$('#clock-1').timeTo();

Usage

$(<selection>).timeTo([options]);

Whithout options it makes simple digital clock with current system time.

where options can be...

Object

Object with initial settings:

  • callback: function that call when countdown end, default null;
  • captionSize: integer font-size by pixels for captions, if 0 then calculate automaticaly, default 0;
  • step: function that is called every {stepCount} ticks, default null
  • stepCount: integer execute {step} every {stepCount} ticks, default 1
  • countdown: boolean if false then it's as clock, default true;
  • countdownAlertLimit: integer seconds left to countdown end after that clock apply CSS class timeTo-alert, default 10;
  • displayDays: integer count of digits days to display, default auto (for backward compatibility true means 3);
  • displayCaption: boolean if true then captions display, default false;
  • displayHours: boolean if false then hide hours, default true;
  • fontFamily: string font-family for digits, default 'Verdana, sans-serif';
  • fontSize: integer font-size by pixels for digits, default 0 - use CSS instead;
  • lang: string language for caption, available 'en', 'ru', 'ua', 'de', 'fr', 'sp', 'it', 'nl', 'no', 'pt', 'pl', default 'en';
  • languages: object extra languages or overrides, first level key is lang, second level keys: 'days', 'hours', 'min', 'sec', default {};
  • seconds: integer initial time in seconds for countdown timer, default 0;
  • start: boolean if true - start timer automaticaly, else need execute .timeTo("start"), default true;
  • theme: string nameof color theme, available "white" and "black", default 'white';
  • time: string time in format 'H:mm:ss' to set the clock, countdown option automaticaly has to be set to false;
  • timeTo: date object specify date and time for current time or for countdown to, default null.

Integer

Initial setting for seconds option

$('#clock').timeTo(100)
// is identical to
$('#clock').timeTo({
    seconds: 100
});

Date object

Initial setting for timeTo option

$('#clock').timeTo(new Date('Dec 10 2013 00:00:00'));
// is identical to
$('#clock').timeTo({
    timeTo: new Date('Dec 10 2013 00:00:00')
});

String

Action for execute. Available: 'start', 'stop', 'reset'.