{"id":18931041,"url":"https://github.com/rendro/countdown","last_synced_at":"2025-04-04T20:09:24.052Z","repository":{"id":4172751,"uuid":"5288768","full_name":"rendro/countdown","owner":"rendro","description":"Simple, lightweight and easy to use jQuery countdown plugin","archived":false,"fork":false,"pushed_at":"2019-03-21T06:09:14.000Z","size":54,"stargazers_count":390,"open_issues_count":6,"forks_count":106,"subscribers_count":35,"default_branch":"master","last_synced_at":"2025-03-28T19:08:13.507Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://rendro.github.io/countdown","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rendro.png","metadata":{"files":{"readme":"Readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-08-03T18:22:41.000Z","updated_at":"2025-02-27T17:19:15.000Z","dependencies_parsed_at":"2022-08-25T20:51:47.913Z","dependency_job_id":null,"html_url":"https://github.com/rendro/countdown","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rendro%2Fcountdown","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rendro%2Fcountdown/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rendro%2Fcountdown/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rendro%2Fcountdown/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rendro","download_url":"https://codeload.github.com/rendro/countdown/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247242678,"owners_count":20907134,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-08T11:40:15.697Z","updated_at":"2025-04-04T20:09:24.031Z","avatar_url":"https://github.com/rendro.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# countdown\n\ncountdown is a jQuery plugin to render countdowns. Instead of unicorns this plugin does not have any magic, but if you like countdowns to be rendered the way you want, this plugin might become your best friend.\n\n## Uber simple setup\n\nTo use the countdown plugin you need to load the current version of jQuery (tested with 1.7.2) and the javascript file of the plugin.\nJust add the following lines to the `head` of your website:\n\n```html\n\u003cscript type=\"text/javascript\" src=\"https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js\"\u003e\u003c/script\u003e\n\u003cscript type=\"text/javascript\" src=\"/path/to/jquery.countdown.js\"\u003e\u003c/script\u003e\n```\n\nThen you have to initialize the plugin with your desired configuration:\n\n```js\n$(function() {\n    $('.yourCountdownContainer').countdown({\n        date: \"June 7, 2087 15:03:26\"\n    });\n});\n```\n\nYep, it's easy like that! Enjoy the time you saved!\n\n## Options\n\nYou can pass a set of these options to set a custom behaviour and look for the plugin.\n\n\u003ctable\u003e\n    \u003ctr\u003e\n        \u003cth\u003eProperty (Type)\u003c/th\u003e\n        \u003cth\u003eDefault\u003c/th\u003e\n        \u003cth\u003eDescription\u003c/th\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd\u003e\u003cstrong\u003edate\u003c/strong\u003e\u003c/td\u003e\n        \u003ctd\u003enew Date(\"June 7, 2087 15:03:25\")\u003c/td\u003e\n        \u003ctd\u003eThe end time of your fancy countdown. Pass either a date object or a string/integer that will be used to create a new Date object. \u003ca href=\"https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Date\" target=\"_blank\"\u003eHere\u003c/a\u003e you can find all accepted formats of this value.\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd\u003e\u003cstrong\u003erefresh\u003c/strong\u003e\u003c/td\u003e\n        \u003ctd\u003e1000\u003c/td\u003e\n        \u003ctd\u003eRefresh rate in milliseconds or false to avoid automatic updates.\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd\u003e\u003cstrong\u003erender\u003c/strong\u003e\u003c/td\u003e\n        \u003ctd colspan=\"2\"\u003eWith the render option you can set a function to change the output of the plugin. This function is called in the scope of the plugin, so you can access the \u003ccode\u003eleadingZeros\u003c/code\u003e method to format numbers as well as public variables and methods. A literal object will be passed to this function as an argument, containing the remaining time parts (years, days, hours, min, sec).\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd\u003e\u003cstrong\u003eonEnd\u003c/strong\u003e\u003c/td\u003e\n        \u003ctd colspan=\"2\"\u003eCallback function that is called when the end date is reached\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n    \t\u003ctd\u003e\u003cstrong\u003eoffset\u003c/strong\u003e\u003c/td\u003e\n        \u003ctd colspan=\"2\"\u003eA period of time (in milliseconds) that is used as offset in time difference calculation between \u003cem\u003enow\u003c/em\u003e and \u003cem\u003eend time\u003c/em\u003e. Useful if countdown calculation to \u003cem\u003eend time\u003c/em\u003e is imprecise due to user's date and time settings.\u003c/td\u003e\n    \u003c/tr\u003e\n\u003c/table\u003e\n\n## Public plugin methods\n\n\u003ctable\u003e\n    \u003ctr\u003e\n        \u003cth\u003emethod(arguments)\u003c/th\u003e\n        \u003cth\u003eDescription\u003c/th\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd\u003e\u003cstrong\u003eleadingZeros\u003c/strong\u003e(\u003cem\u003enumber, [length = 2]\u003c/em\u003e)\u003c/td\u003e\n        \u003ctd\u003eAdd leading zeros to a number.\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd\u003e\u003cstrong\u003eupdate\u003c/strong\u003e(\u003cem\u003enewDate\u003c/em\u003e)\u003c/td\u003e\n        \u003ctd\u003eUpdate the end time. The possible formats of the argument \u003ccode\u003enewDate\u003c/code\u003e are the same as described in the \u003ccode\u003edate\u003c/code\u003e-option above.\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd\u003e\u003cstrong\u003eupdateOffset\u003c/strong\u003e(\u003cem\u003enewOffset\u003c/em\u003e)\u003c/td\u003e\n        \u003ctd\u003eUpdate the offset (time in milliseconds).\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd\u003e\u003cstrong\u003erender\u003c/strong\u003e()\u003c/td\u003e\n        \u003ctd\u003eCall the render method. This might be usefull if you set \u003ccode\u003erefresh\u003c/code\u003e to false.\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd\u003e\u003cstrong\u003estop\u003c/strong\u003e()\u003c/td\u003e\n        \u003ctd\u003eStops the refresh loop.\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd\u003e\u003cstrong\u003estart\u003c/strong\u003e(\u003cem\u003e[refreshRate]\u003c/em\u003e)\u003c/td\u003e\n        \u003ctd\u003eStart the refresh loop. If you set a refresh rate in the options you can overwrite it with the argument \u003ccode\u003erefreshRate\u003c/code\u003e. If you don't pass an argument, the old value or the default value of 1 sec will be used.\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd\u003e\u003cstrong\u003erestart\u003c/strong\u003e(\u003cem\u003eoptions\u003c/em\u003e)\u003c/td\u003e\n        \u003ctd\u003eUpdate the options and restart the countdown\u003c/td\u003e\n    \u003c/tr\u003e\n\u003c/table\u003e\n\n## Changelog\n\n### Version 2.2.0 - \u003csmall\u003eMay 6, 2016\u003c/small\u003e\n* added restart countdown api method (Thanks @scazzy)\n* Fixed bower dependencies and main field\n\n### Version 2.1.0 - \u003csmall\u003eOct 13, 2014\u003c/small\u003e\n* Added time offset option to fix time differences between server and client time (#8)\n\n### Version 2.0.0 - \u003csmall\u003eOct 13, 2014\u003c/small\u003e\n* removed coffee-script dependency\n* added vanilla version\n* add UMD wrapper (commonJS, require.js, global)\n* added support to define the end date with the data-date attribute (#14)\n\n### Version 1.0.1 - \u003csmall\u003eMay 01, 2013\u003c/small\u003e\n* Added callback function when the end date is reached\n\n### Version 1.0.0 - \u003csmall\u003eAug 05, 2012\u003c/small\u003e\n* Initial release\n\n## License\n\n`countdown` is dual licensed under the [MIT](http://www.opensource.org/licenses/mit-license.php) and [GPL-3.0](http://opensource.org/licenses/GPL-3.0) licenses.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frendro%2Fcountdown","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frendro%2Fcountdown","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frendro%2Fcountdown/lists"}