Security News
RubyGems.org Adds New Maintainer Role
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
ember-cli-clock
Advanced tools
[![Build Status](https://travis-ci.org/jerel/ember-cli-clock.svg?branch=master)](https://travis-ci.org/jerel/ember-cli-clock)
A simple clock service for Ember.js
View a live demo here: http://clock.jerel.co/
ember install ember-cli-clock
Generate a clock service
ember generate clock my-shiny-new-clock
Inject the my-shiny-new-clock
service into your component, controller,
route, ...
clock: Ember.inject.service('my-shiny-new-clock')
Use the time
(Date.now()
) and date
(Date
instance) properties
of the clock service
// app/components/iso-date.js
export default Ember.Component.extend({
clock: Ember.inject.service('my-shiny-new-clock'),
iso: Ember.computed('clock.date', function() {
return this.get('clock.date').toISOString();
})
});
Using {{iso}}
in the template will output something like
2011-10-05T14:48:00.000Z
and update it every second.
// app/components/device-status.js
export default Ember.Component.extend({
clock: Ember.inject.service('my-shiny-new-clock'),
isOnline: Ember.computed('lastContact', 'clock.time', function() {
return this.get('clock.time') - this.get('lastContact') < 60 * 1000;
})
});
The isOnline
property is updated every second and will tell
if the last contact of the device was less than 60 seconds ago.
interval
(default: 1000ms) - the update interval of time
and date
time
(read-only) - will be set to Date.now()
every interval
millisecondsdate
(read-only) - computed property: new Date(this.get('time'))
start()
- starts the clock after it has been stoppedstop()
- stops the clock from updating time
and date
until restartedCopyright (c) 2014 Jerel Unruh and contributors
FAQs
The default blueprint for ember-cli addons.
The npm package ember-cli-clock receives a total of 89 weekly downloads. As such, ember-cli-clock popularity was classified as not popular.
We found that ember-cli-clock demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.
Security News
Research
Socket's threat research team has detected five malicious npm packages targeting Roblox developers, deploying malware to steal credentials and personal data.