I'm trying to make a dashboard for work with Smashing (used to be called Dashing), it runs on a Raspberry Pi 3B.
I am new to coffeescript. I'm trying to make an open sign, It should: Check the day and the hours and if it is tuesday, wednesday or friday between 9am and 5pm it should print "We are opened, come in" and if it's outside those hours it should say something like "We are closed, please come again" the open text should also be applied on thursday between 9am and 1pm and the rest of the time it should say closed.
Here is the code I was trying to edit and change from the clock widget:
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())
###
openTime: ->
if h > 8 and < 6 then @set('openclosed', "Wij zijn open, kom gezellig binnen!") else @set('openclosed', "Wij zijn gesloten, kom gauw weer terug!")
###
formatTime: (i) ->
if i < 10 then "0" + i else i
The commented out part is what I added, obviously to experienced people it's not working..
Thanks in advance! Greetings, Thursten