From adfdbbfce5fd5f7f4a27afa6d444ae825f310fe1 Mon Sep 17 00:00:00 2001 From: Arthur DANJOU Date: Wed, 19 Mar 2025 10:51:09 +0100 Subject: [PATCH] Testing --- app/components/home/Stats.vue | 40 ++++++++++++++++++++++++++++++++++- 1 file changed, 39 insertions(+), 1 deletion(-) diff --git a/app/components/home/Stats.vue b/app/components/home/Stats.vue index 961a9af..9d94845 100644 --- a/app/components/home/Stats.vue +++ b/app/components/home/Stats.vue @@ -6,16 +6,54 @@ const { locale, locales } = useI18n() const currentLocale = computed(() => locales.value.find(l => l.code === locale.value)) const { data: stats } = await useFetch('/api/stats') -console.log(stats.value) const { t } = useI18n({ useScope: 'local', }) +const time = useTimeAgo(new Date(stats.value!.coding.data.range.start) ?? new Date()).value.split(' ')[0] +const date = useDateFormat(new Date(stats.value!.coding.data.range.start ?? new Date()), 'DD MMMM YYYY', { locales: currentLocale.value?.code ?? 'en' }) +const hours = usePrecision(stats.value!.coding.data.grand_total.total_seconds_including_other_language / 3600, 0)