Browse Source

include timestamp

Martin Kunz 5 years ago
parent
commit
72cf9c97f4
3 changed files with 4608 additions and 3 deletions
  1. 5 3
      webroot/index.html
  2. 4602 0
      webroot/js/moment.js
  3. 1 0
      webroot/js/moment.min.js

+ 5 - 3
webroot/index.html

@@ -4,8 +4,7 @@
     <meta charset="utf-8">
     <title>Vue.js markdown editor example</title>
     <link rel="stylesheet" href="css/style.css">
-    <script src="https://unpkg.com/lodash@4.16.0"></script>
-    <!-- Delete ".min" for console warnings in development -->
+    <script src="js/moment.js"></script>
     <script src="js/vue.js"></script>
 </head>
 <body>
@@ -17,7 +16,7 @@
 
     <ul id="loglist">
         <li v-for="(item, index) in log.slice().reverse()">
-            {{ index }} - {{ item.entry.message }}
+            {{ index }} - {{ item.entry.message }} -  {{ ts2txt(item.ts) }}
         </li>
     </ul>
 </div>
@@ -46,6 +45,9 @@
                         return response;
                     });
             },
+            ts2txt: function (ts) {
+                return moment(ts).format('YYYY-MM-DD [at] hh:mm')
+            },
             update: function (event) {
                 fetch('/log/'+this.lastID, {method: "GET"})
                     .then((response) => {

File diff suppressed because it is too large
+ 4602 - 0
webroot/js/moment.js


File diff suppressed because it is too large
+ 1 - 0
webroot/js/moment.min.js