From 4c5be8cf8d942743398581b46ac2c76d0ff273d8 Mon Sep 17 00:00:00 2001
From: Yuval Adam <_@yuv.al>
Date: Wed, 24 Sep 2025 09:12:44 +0200
Subject: Initial migration

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

(limited to 'src/components/Datetime.tsx')

diff --git a/src/components/Datetime.tsx b/src/components/Datetime.tsx
new file mode 100644
index 0000000..2010f8b
--- /dev/null
+++ b/src/components/Datetime.tsx
@@ -0,0 +1,28 @@
+import React from "react";
+import { DateTime as LuxonDateTime } from "luxon";
+
+interface DateTimeProps {
+  images: string[];
+  slider: number;
+}
+
+export function DateTime({ images, slider }: DateTimeProps) {
+  let datetime: LuxonDateTime | null = null;
+
+  if (images.length > 0 && images[slider]) {
+    const ds = images[slider].substring(5, 18);
+    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>
+  );
+}
\ No newline at end of file
-- 
cgit v1.3.1

