Browse Source

Add date_display template with non-reactive date.

Frederic G. MARAND 8 years ago
parent
commit
8305c0cacf
2 changed files with 13 additions and 0 deletions
  1. 6 0
      textcircle.html
  2. 7 0
      textcircle.js

+ 6 - 0
textcircle.html

@@ -4,9 +4,15 @@
 
 <body>
   <h1>Welcome to TextCircle!</h1>
+  <p>{{> date_display }}</p>
+
   {{> editor}}
 </body>
 
+<template name="date_display">
+  {{ current_date }}
+</template>
+
 <template name="editor">
 <h2>doc id: {{ docid }}</h2>
   {{> sharejsCM docid=docid id="editor" }}

+ 7 - 0
textcircle.js

@@ -8,6 +8,13 @@ if (Meteor.isClient) {
       return doc ? doc._id : undefined;
     }
   });
+
+  Template.date_display.helpers({
+    current_date: function () {
+      return new Date();
+    }
+
+  });
 }
 
 if (Meteor.isServer) {