{"id":14482592,"url":"https://github.com/kemar/jquery.countdown","last_synced_at":"2025-08-30T03:31:31.616Z","repository":{"id":5861265,"uuid":"7078234","full_name":"kemar/jquery.countdown","owner":"kemar","description":"Unobtrusive and easily skinable countdown jQuery plugin generating a \u003ctime\u003e tag.","archived":false,"fork":false,"pushed_at":"2020-12-29T16:11:15.000Z","size":106,"stargazers_count":81,"open_issues_count":3,"forks_count":31,"subscribers_count":7,"default_branch":"master","last_synced_at":"2024-08-04T18:04:19.725Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://kemar.github.io/jquery.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/kemar.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-12-09T11:55:49.000Z","updated_at":"2023-06-18T12:14:53.000Z","dependencies_parsed_at":"2022-09-24T00:00:34.555Z","dependency_job_id":null,"html_url":"https://github.com/kemar/jquery.countdown","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kemar%2Fjquery.countdown","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kemar%2Fjquery.countdown/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kemar%2Fjquery.countdown/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kemar%2Fjquery.countdown/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kemar","download_url":"https://codeload.github.com/kemar/jquery.countdown/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":217593012,"owners_count":16201561,"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-09-03T00:01:11.924Z","updated_at":"2024-09-03T00:03:34.464Z","avatar_url":"https://github.com/kemar.png","language":"JavaScript","readme":"# [jQuery Countdown](https://github.com/kemar/jquery.countdown)\n\nUnobtrusive and easily skinable countdown jQuery plugin generating a `\u003ctime\u003e` tag.\n\n[Live demo](https://kemar.github.io/jquery.countdown/).\n\n\n## Supported browsers\n\nTo use the countdown jQuery plugin you need an [up-to-date web browser supporting the HTML5 time element](http://caniuse.com/#feat=html5semantic).\n\n\n## Installation\n\nGet the plugin [from `npm`](https://www.npmjs.com/package/jquery.countdown):\n\n```sh\n$ npm install jquery.countdown\n```\n\nOr include this script after jQuery.\n\n```html\n\u003cscript src=\"jquery.js\"\u003e\u003c/script\u003e\n\u003cscript src=\"jquery.countdown.js\"\u003e\u003c/script\u003e\n```\n\n\n## Usage\n\nCreate a countdown from the **value** of the `datetime` **attribute** of a `\u003ctime\u003e` tag (valid global date and time, time or duration).\n\n```html\n\u003ctime datetime=\"2013-12-13T17:43:00\"\u003eFriday, December 13th, 2013 5:43pm\u003c/time\u003e\n\u003ctime datetime=\"02:30:30\"\u003eExpires in 2 hours 30 minutes 30 seconds\u003c/time\u003e\n\u003ctime datetime=\"P61D\"\u003e61 days\u003c/time\u003e\n```\n\nCreate a countdown from a [valid global date and time](https://html.spec.whatwg.org/multipage/infrastructure.html#valid-global-date-and-time-string) string (with time-zone offset).\n\n```html\n\u003cdiv\u003e2012-12-08T17:47:00+0100\u003c/div\u003e\u003c!-- Paris (winter) --\u003e\n\u003cdiv\u003e2012-12-08T08:47:00-0800\u003c/div\u003e\u003c!-- California --\u003e\n\u003cdiv\u003e2012-12-08T16:47:00+0000\u003c/div\u003e\u003c!-- UTC --\u003e\n```\n\nCreate a countdown from a [valid time](https://html.spec.whatwg.org/multipage/infrastructure.html#valid-time-string) string.\n\n```html\n\u003cdiv\u003e12:30\u003c/div\u003e\n\u003cdiv\u003e12:30:39\u003c/div\u003e\n\u003cdiv\u003e12:30:39.929\u003c/div\u003e\n```\n\nCreate a countdown from a [valid duration](https://html.spec.whatwg.org/multipage/infrastructure.html#valid-duration-string) string.\n\n```html\n\u003cdiv\u003eP2D\u003c/div\u003e\n\u003cdiv\u003ePT01H01M15S\u003c/div\u003e\n\u003cdiv\u003ePT20M20S\u003c/div\u003e\n\u003cdiv\u003ePT10S\u003c/div\u003e\n```\n\nCreate a countdown from the **string representation** of a [Python `timedelta` object](https://docs.python.org/3/library/datetime.html#timedelta-objects).\n\n```html\n\u003cdiv\u003e600 days, 3:59:12\u003c/div\u003e\n\u003cdiv\u003e00:59:00\u003c/div\u003e\n\u003cdiv\u003e3:59:12\u003c/div\u003e\n```\n\nCreate a countdown from a human readable duration string.\n\n```html\n\u003ch1\u003e24h00m59s\u003c/h1\u003e\n\u003ch1\u003e2h 0m\u003c/h1\u003e\n\u003ch1\u003e4h 18m 3s\u003c/h1\u003e\n\u003ch1\u003e600 days, 3:59:12\u003c/h1\u003e\n\u003ch1\u003e600 jours, 3:59:12\u003c/h1\u003e\n\u003ch1\u003e00:01\u003c/h1\u003e\n\u003ch1\u003e240:00:59\u003c/h1\u003e\n```\n\nCreate a countdown from a string that can be interpreted by the [JavaScript `Date.parse()` function](http://www.ecma-international.org/ecma-262/5.1/#sec-15.9.4.2).\n\n```html\n\u003cdiv\u003e\u003cscript\u003edocument.write(date.toDateString())\u003c/script\u003e\u003c/div\u003e\n\u003cdiv\u003e\u003cscript\u003edocument.write(date.toGMTString())\u003c/script\u003e\u003c/div\u003e\n\u003cdiv\u003e\u003cscript\u003edocument.write(date.toISOString())\u003c/script\u003e\u003c/div\u003e\n\u003cdiv\u003e\u003cscript\u003edocument.write(date.toUTCString())\u003c/script\u003e\u003c/div\u003e\n```\n\n\n## Rock'n'roll\n\n```javascript\n$('div, h1, time').countDown();\n```\n\n\n## Available options\n\n- `css_class`: the css class of the generated `\u003ctime\u003e` tag (default: `countdown`).\n- `always_show_days`: always display days if true even if none remains (default: `false`).\n- `with_labels`: display or hide labels (default: `true`).\n- `with_seconds`: display or hide seconds (default: `true`).\n- `with_separators`: display or hide separators between days, hours, minutes and seconds (default: `true`).\n- `with_hh_leading_zero`: always display hours in 2 digit format with a leading zero when appropriate (default: `true`).\n- `with_mm_leading_zero`: always display minutes in 2 digit format with a leading zero when appropriate (default: `true`).\n- `with_ss_leading_zero`: always display seconds in 2 digit format with a leading zero when appropriate (default: `true`).\n- `label_dd`: label's text for days (default: `days`).\n- `label_hh`: label's text for hours (default: `hours`).\n- `label_mm`: label's text for minutes (default: `minutes`).\n- `label_ss`: label's text for seconds (default: `seconds`).\n- `separator`: separator character between hours, minutes and seconds (default: `:`).\n- `separator_days`: separator character between days and hours (default: `,`).\n\n\n## Events\n\n`time.elapsed`: this event fires immediately when the time is elapsed.\n\n```javascript\n$('#my-countdown').on('time.elapsed', function () {\n    // do something...\n});\n```\n\n`time.tick`: by default, this event fires every second(ish), the second passed parameter is the number of miliseconds left. Useful if you're doing something like a bar that fills up as time runs out.\n\n```javascript\n$('#my-countdown').on('time.tick', function (ev, ms) {\n    // do something...\n});\n```\n\n\n## Generated markup\n\nA valid `\u003ctime\u003e` tag representing a duration is generated.\n\n```html\n\u003ctime class=\"countdown\" datetime=\"P12DT05H16M22S\"\u003e\n    \u003cspan class=\"item item-dd\"\u003e\n        \u003cspan class=\"dd\"\u003e\u003c/span\u003e\n        \u003cspan class=\"label label-dd\"\u003edays\u003c/span\u003e\n    \u003c/span\u003e\n    \u003cspan class=\"separator separator-dd\"\u003e,\u003c/span\u003e\n    \u003cspan class=\"item item-hh\"\u003e\n        \u003cspan class=\"hh-1\"\u003e\u003c/span\u003e\n        \u003cspan class=\"hh-2\"\u003e\u003c/span\u003e\n        \u003cspan class=\"label label-hh\"\u003ehours\u003c/span\u003e\n    \u003c/span\u003e\n    \u003cspan class=\"separator\"\u003e:\u003c/span\u003e\n    \u003cspan class=\"item item-mm\"\u003e\n        \u003cspan class=\"mm-1\"\u003e\u003c/span\u003e\n        \u003cspan class=\"mm-2\"\u003e\u003c/span\u003e\n        \u003cspan class=\"label label-mm\"\u003eminutes\u003c/span\u003e\n    \u003c/span\u003e\n    \u003cspan class=\"separator\"\u003e:\u003c/span\u003e\n    \u003cspan class=\"item item-ss\"\u003e\n        \u003cspan class=\"ss-1\"\u003e\u003c/span\u003e\n        \u003cspan class=\"ss-2\"\u003e\u003c/span\u003e\n        \u003cspan class=\"label label-ss\"\u003eseconds\u003c/span\u003e\n    \u003c/span\u003e\n\u003c/time\u003e\n```\n\n\n## Acknowledgements\n\nReleased under the [MIT License](http://opensource.org/licenses/mit-license).\n\nIssues should be opened through [GitHub Issues](https://github.com/kemar/jquery.countdown/issues/).\n\n[jQuery Countdown](https://github.com/kemar/jquery.countdown) is authored and maintained by [Kemar](https://marcarea.com).\n","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkemar%2Fjquery.countdown","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkemar%2Fjquery.countdown","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkemar%2Fjquery.countdown/lists"}