ember-cli-clock icon indicating copy to clipboard operation
ember-cli-clock copied to clipboard

Request: Initialise clock to number of seconds past the hour

Open abradner opened this issue 10 years ago • 3 comments

I'm happy to write this and submit a PR, but I want to know if it's a) in scope and b) wanted before I write it.

Basically, the use case is having Clock's hour/quarter/five/minute methods tick at the same time (or close enough) to wall clock time, so properties that should update on the hour/minute/etc can just observe clock.method instead of doing some other tricky things

The easiest way I can see to do that is to set the initial value to be seconds past the hour or seconds past midnight.

Would this be valuable?

abradner avatar Dec 16 '15 04:12 abradner

I would be happy with this being added as long as it can be done without a) making it slow or b) making it much more complex. Setting the initial value to seconds as you suggest seems like it should work well

jerel avatar Dec 19 '15 15:12 jerel

An update on this? Sounds like just what I was looking for as well.

makeitTim avatar Apr 12 '16 18:04 makeitTim

@makeitTim this addon has been refactored to a service since this issue was opened. You could likely now achieve what you want by calling stop() after init, setting the interval to whatever you want, and then calling start() at the time needed to kick it off

jerel avatar Apr 14 '16 13:04 jerel