https://github.com/andyklimczak/ember-countdown
Ember-cli addon for countdownjs
https://github.com/andyklimczak/ember-countdown
countdown ember-cli ember-cli-addon ember-countdown emberjs
Last synced: about 2 months ago
JSON representation
Ember-cli addon for countdownjs
- Host: GitHub
- URL: https://github.com/andyklimczak/ember-countdown
- Owner: andyklimczak
- License: mit
- Created: 2016-05-10T01:41:23.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2019-03-20T03:03:40.000Z (about 6 years ago)
- Last Synced: 2025-04-12T10:08:20.562Z (about 2 months ago)
- Topics: countdown, ember-cli, ember-cli-addon, ember-countdown, emberjs
- Language: JavaScript
- Homepage:
- Size: 220 KB
- Stars: 3
- Watchers: 2
- Forks: 4
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# ember-countdown
[](https://travis-ci.org/andyklimczak/ember-countdown)Ember-cli addon for [countdownjs](https://github.com/mckamey/countdownjs), and allowing countdownjs to be consumed as an ES6 module in your ember application.
```shell
ember install ember-countdown
```
```javascript
import countdown from 'countdownjs';
```As a component:
```javascript
{{countdown-string startDate='11/24/1992 17:56:53 GMT'}}
```
=> ```25 years, 6 months, 18 days, 7 hours, 43 minutes and 35 seconds``````javascript
{{countdown-html startDate='1992/11/24'}}
```
=> ```25 years, 6 months, 18 days, 7 hours, 43 minutes and 57 seconds```To create a countdown that only has months and days, create a new component in your project that extends the components from this addon:
```javascript
import countdown from 'countdownjs';
import CountdownString from 'ember-countdown/components/countdown-string';export default CountdownString.extend({
units: countdown.MONTHS|countdown.DAYS
});
```Other values can be overriden as well:
```javascript
import countdown from 'countdownjs';
import CountdownHTML from 'ember-countdown/components/countdown-html';export default CountdownHTML.extend({
htmlTag: 'b',
units: countdown.SECONDS
});
```
WARNING: If you use `ember generate component my-countdown`, make sure to delete the generated template file `components/my-countdown.hbs` or nothing will appear.Further usage examples for the two components with all optional parameters explored can be seen in the [integration tests](https://github.com/andyklimczak/ember-countdown/tree/master/tests/integration/components) and the addon's [dummy app](https://github.com/andyklimczak/ember-countdown/blob/master/tests/dummy/app/templates/application.hbs). Explanation of the parameters is documented in the [countdownjs](https://github.com/mckamey/countdownjs) readme.
## Development Installation
* `git clone` this repository
* `npm install`### Running
* `ember server`
* Visit your app at http://localhost:4200.### Running Tests
* `npm test` (Runs `ember try:each` to test your addon against multiple Ember versions)
* `ember test`
* `ember test --server`### Building
* `ember build`
For more information on using ember-cli, visit [https://ember-cli.com/](https://ember-cli.com/).