signage: bring in from external repo

This is b28e6f07aa48f1e2f01eb37bffa180f97a7b03bd from
https://code.hackerspace.pl/q3k/love2d-signage/. We only keep code
commited by inf and q3k, and we're both now licensing this code under
the ISC license, as per COPYING in the root of hscloud.

Change-Id: Ibeee2e6923605e4b1a17a1d295867c056863ef59
Reviewed-on: https://gerrit.hackerspace.pl/c/hscloud/+/1335
Reviewed-by: informatic <informatic@hackerspace.pl>
Reviewed-by: q3k <q3k@hackerspace.pl>
diff --git a/hswaw/signage/nodes/time.lua b/hswaw/signage/nodes/time.lua
new file mode 100644
index 0000000..48b5110
--- /dev/null
+++ b/hswaw/signage/nodes/time.lua
@@ -0,0 +1,25 @@
+local node = Node:extend('nodes.time', {})
+
+local textFont = love.graphics.newFont('fonts/Lato-Thin.ttf', 400)
+local smallFont = love.graphics.newFont('fonts/Lato-Light.ttf', 60)
+
+function node:init(config)
+  node.super.init(self, config)
+  self.timeFormat = self.timeFormat or '%H:%M'
+  self.dateFormat = self.dateFormat or '%Y/%m/%d'  
+end
+
+function node:render()
+  love.graphics.setColor( 0, 0, 0 )
+  love.graphics.rectangle("fill", 0, 0, love.graphics.getWidth(), love.graphics.getHeight())
+
+  love.graphics.setColor( 1.0, 1.0, 1.0 )
+
+  love.graphics.setFont(textFont);
+  love.graphics.printf(os.date(self.timeFormat), 0, 0.14*love.graphics.getHeight(), love.graphics.getWidth(), 'center');
+
+  love.graphics.setFont(smallFont);
+  love.graphics.printf(os.date(self.dateFormat), 0, 0.8*love.graphics.getHeight(), love.graphics.getWidth(), 'center');
+end
+
+return node