From 5b8851b6c268d0e93c158908fbfae9f8473db5ff Mon Sep 17 00:00:00 2001
From: Orangerot <purple@orangerot.dev>
Date: Wed, 19 Jun 2024 00:14:49 +0200
Subject: Initial commit

---
 pse-dashboard/src/components/ProgressTime.vue | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)
 create mode 100644 pse-dashboard/src/components/ProgressTime.vue

(limited to 'pse-dashboard/src/components/ProgressTime.vue')

diff --git a/pse-dashboard/src/components/ProgressTime.vue b/pse-dashboard/src/components/ProgressTime.vue
new file mode 100644
index 0000000..61bd421
--- /dev/null
+++ b/pse-dashboard/src/components/ProgressTime.vue
@@ -0,0 +1,23 @@
+<script setup>
+import { computed } from 'vue'
+import dayjs from 'dayjs/esm'
+import utc from 'dayjs/esm/plugin/utc'
+dayjs.extend(utc)
+
+const props = defineProps({
+    unix: {
+        type: Number,
+        default: 0
+    }
+});
+
+// compute hours, minutes and seconds from unix-seconds whenever data changes
+const progressTime = computed(() => dayjs.utc(props.unix * 1000).format("HH:mm:ss"));
+
+</script>
+<template>
+    {{ progressTime }}
+</template>
+<style scoped>
+</style>
+
-- 
cgit v1.2.3

