Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nypublicradio/nypr-election-countdown
extends nypr-countdown to display how much time remains until election day
https://github.com/nypublicradio/nypr-election-countdown
Last synced: about 1 month ago
JSON representation
extends nypr-countdown to display how much time remains until election day
- Host: GitHub
- URL: https://github.com/nypublicradio/nypr-election-countdown
- Owner: nypublicradio
- License: mit
- Created: 2018-08-10T20:56:28.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-04-01T08:38:36.000Z (almost 2 years ago)
- Last Synced: 2024-04-10T20:53:18.647Z (10 months ago)
- Language: JavaScript
- Size: 3.72 MB
- Stars: 0
- Watchers: 7
- Forks: 1
- Open Issues: 29
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
Awesome Lists containing this project
README
nypr-election-countdown
==============================================================================Provides a {{election-countdown}} component that calculates the time remaining
until election day and renders the appropriate HTML.Installation
------------------------------------------------------------------------------```
ember install nypr-election-countdown
```Add timezone configuration to your app's `config/environment.js`:
```
module.exports = function(environment) {
let ENV = {...
moment: {
includeTimezone: 'all'
},...
}
return ENV;
};
```Usage
------------------------------------------------------------------------------Inline usage:
`{{election-countdown unit='days' from=from to='2018-11-06T06:00:00-5:00'}}`
The `from` param defaults to now if excluded. You can use `moment()` or String
values for the `from` and `to` params. If you use Strings, they
must follow the ISO 8601 format. Any of the following work:- simple date: 2018-6-25
- simple datetime: 2018-6-25T11:30:00
- date time with timezone offset: 2018-6-25T11:30:00-4:00Block usage:
Note that this addon renders a block of HTML specific to the midterm elections,
including different text treatments depending on whether your `from` date is
before, equal to, or after election day. For that reason, block usage of the
component isn't recommended unless all you need is to add an extra wrapper
around the rendered HTML. (You won't have much additional control.)Contributing
------------------------------------------------------------------------------### Installation
* `git clone `
* `cd nypr-election-countdown`
* `npm install`### Linting
* `npm run lint:js`
* `npm run lint:js -- --fix`### Running tests
* `ember test` – Runs the test suite on the current Ember version
* `ember test --server` – Runs the test suite in "watch mode"
* `ember try:each` – Runs the test suite against multiple Ember versions### Running the dummy application
* `ember serve`
* Visit the dummy application at [http://localhost:4200](http://localhost:4200).For more information on using ember-cli, visit [https://ember-cli.com/](https://ember-cli.com/).
License
------------------------------------------------------------------------------This project is licensed under the [MIT License](LICENSE.md).