From 86109dcfd008baf8778cc221cc25f90dd77121e9 Mon Sep 17 00:00:00 2001
From: Jarred Sumner <jarred@jarredsumner.com>
Date: Mon, 27 Sep 2021 01:33:15 -0700
Subject: Add a few macros examples

---
 examples/macros/now.tsx | 10 ++++++++++
 1 file changed, 10 insertions(+)
 create mode 100644 examples/macros/now.tsx

(limited to 'examples/macros/now.tsx')

diff --git a/examples/macros/now.tsx b/examples/macros/now.tsx
new file mode 100644
index 000000000..d5a9e7912
--- /dev/null
+++ b/examples/macros/now.tsx
@@ -0,0 +1,10 @@
+import moment from "moment";
+export function now(node) {
+  var fmt = "HH:mm:ss";
+  const args = node.arguments;
+  if (args[0] instanceof <string />) {
+    fmt = args[0].get();
+  }
+  const time = moment().format(fmt);
+  return <string value={time}></string>;
+}
-- 
cgit v1.2.3

