Browse Source

Add last update hour and formatting

Rorist 5 years ago
parent
commit
af989f0c8a
2 changed files with 9 additions and 3 deletions
  1. 8 2
      main.js
  2. 1 1
      style.css

+ 8 - 2
main.js

@@ -42,6 +42,10 @@ function changeHour(inc) {
     checkHours();
 }
 
+function pad(n) {
+    return ("0" + n).slice(-2);
+}
+
 function updateSpaceInformation() {
     "use strict";
     loadBlock.show();
@@ -61,8 +65,10 @@ function updateSpaceInformation() {
             closeBlock.hide();
             document.hoursform.hours.focus();
         }
-        var date = new Date(data.state.lastchange * 1000);
-        updateBlock.html('Last update: ' + date.toDateString());
+        updateBlock.html('Last update:<br/>'
+            + closing_time.toDateString()
+            + ' ' + pad(closing_time.getHours())
+            + ':' + pad(closing_time.getMinutes()));
         msgBlock.html(data.state.message);
         loadBlock.hide();
         checkHours();

+ 1 - 1
style.css

@@ -163,7 +163,7 @@ all the button
 }
 
 #update-block {
-    font-size: 1.1em;
+    font-size: 1.2em;
 }
 
 .text-input {