From 44a1c5b7e62e83af4d670e011f5998b9b8aedfef Mon Sep 17 00:00:00 2001
From: Yuval Adam <_@yuv.al>
Date: Mon, 29 Aug 2022 10:24:51 +0300
Subject: Update all .tsx files and remove unused

---
 src/Datetime.tsx | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)
 create mode 100644 src/Datetime.tsx

(limited to 'src/Datetime.tsx')

diff --git a/src/Datetime.tsx b/src/Datetime.tsx
new file mode 100644
index 0000000..9807211
--- /dev/null
+++ b/src/Datetime.tsx
@@ -0,0 +1,26 @@
+import React from "react";
+import { DateTime as LuxonDateTime } from "luxon";
+
+function DateTime(props) {
+  let { images, slider } = props;
+  let datetime = null;
+
+  if (images.length > 0) {
+    const ds = images[slider].substr(5, 13);
+    datetime = LuxonDateTime.fromFormat(ds, "yyyyMMdd/HHmm", {
+      zone: "utc",
+    }).setZone("Asia/Jerusalem");
+  }
+
+  const date = datetime ? datetime.toFormat("dd/MM/y") : "";
+  const time = datetime ? datetime.toFormat("HH:mm") : "";
+
+  return (
+    <div id="datetime">
+      <div id="date">{date}</div>
+      <div id="time">{time}</div>
+    </div>
+  );
+}
+
+export default DateTime;
-- 
cgit v1.3.1

