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)