Sha256: faac257169ed6a24483fa408007291758b1b0e52f596bdb3fe37f28d33b8bb80

Contents?: true

Size: 389 Bytes

Versions: 56

Compression:

Stored size: 389 Bytes

Contents

class Dashing.Clock extends Dashing.Widget

  ready: ->
    setInterval(@startTime, 500)

  startTime: =>
    today = new Date()

    h = today.getHours()
    m = today.getMinutes()
    s = today.getSeconds()
    m = @formatTime(m)
    s = @formatTime(s)
    @set('time', h + ":" + m + ":" + s)
    @set('date', today.toDateString())

  formatTime: (i) ->
    if i < 10 then "0" + i else i

Version data entries

56 entries across 56 versions & 7 rubygems

Version Path
dashing-rails-1.0.3 app/views/dashing/default_widgets/clock/clock.coffee
dashing-rails-1.0.2 app/views/dashing/default_widgets/clock/clock.coffee
dashing-1.3.1 templates/project/widgets/clock/clock.coffee
dashing-1.3.0 templates/project/widgets/clock/clock.coffee
dashing-rails-1.0.1 app/views/dashing/default_widgets/clock/clock.coffee
dashing-rails-1.0.0 app/views/dashing/default_widgets/clock/clock.coffee
dashing-1.2.0 templates/project/widgets/clock/clock.coffee
dashing-1.1.0 templates/project/widgets/clock/clock.coffee
dashing-1.0.6 templates/project/widgets/clock/clock.coffee
dashing-1.0.5 templates/project/widgets/clock/clock.coffee
dashing-1.0.4 templates/project/widgets/clock/clock.coffee
dashing-1.0.3 templates/project/widgets/clock/clock.coffee
dashing-1.0.2 templates/project/widgets/clock/clock.coffee
dashing-1.0.1 templates/project/widgets/clock/clock.coffee
dashing-1.0 templates/project/widgets/clock/clock.coffee
dashing-0.1.2 templates/project/widgets/clock/clock.coffee