Leonidas-from-XIV / floatinghands

A watch, as a CoffeeScript jQuery plugin. Or somethin'
3 stars 0 forks source link

Implement function for date correction button #6

Closed watchdesigner closed 13 years ago

watchdesigner commented 13 years ago

In the example watch we are currently using, you see that there is a 3rd push button at 10h, which does nothing at the moment.

In the real watch, this button simply sets the date one day forward. That function would complete our first demo nicely (whereas at the moment you try it and see that nothing happens...). I am wondering how much it will take to implement that function - is the plugin somehow already capable of doing that and we just need to "activate" it in the HTML file with a few lines of code?

Leonidas-from-XIV commented 13 years ago

See the demo how to do it.

Leonidas-from-XIV commented 13 years ago

Actually, technically you could (in a feasible way) solve this without library support, just supply your own timeFn to the date control, which returns a date with the proper offset and add a pressed handler to the date-button that increments that offset. But I figured this might be handy for more than one watch, therefore I added the functionality to the library directly.

watchdesigner commented 13 years ago

Works fine. Looking at your above comment, yes I think that sounds cleaner than the current solution. Would you mind writing that function in the HTML file so I can see how exactly it works. We can pack it together with other standard functions and put it in the library later.

Btw, obviously I oriented the numbers on the date disk counter clockwise. That should not mean we put a negative delta in the code. I'll rather redo the date disk when I have time.

watchdesigner commented 13 years ago

Oh and btw, the function name "toggleDate" is quite confusing I think. In watch language you call that button "date corrector"; however "correctDate" would also be confusing. Let's just call it "setDate" or so.

Leonidas-from-XIV commented 13 years ago

There you go, moved the logic to watch.html, as you see no big deal. And yeah, it would be cool if you could re-do the date wheel some time.