mirror of
https://github.com/ArthurDanjou/artsite.git
synced 2026-01-14 15:54:13 +01:00
fix: corriger la déclaration de totalHours dans le composant Stats
This commit is contained in:
@@ -5,11 +5,10 @@ import { usePrecision } from '@vueuse/math'
|
|||||||
const { data: stats } = await useAsyncData<Stats>('stats', () => $fetch('/api/stats'))
|
const { data: stats } = await useAsyncData<Stats>('stats', () => $fetch('/api/stats'))
|
||||||
|
|
||||||
const startDate = computed(() => new Date(stats.value?.coding?.range?.start ?? new Date()))
|
const startDate = computed(() => new Date(stats.value?.coding?.range?.start ?? new Date()))
|
||||||
|
const totalHours = usePrecision((stats.value?.coding?.grand_total?.total_seconds_including_other_language ?? 0) / 3600, 0)
|
||||||
const yearsCollected = useTimeAgo(startDate)
|
const yearsCollected = useTimeAgo(startDate)
|
||||||
const formattedDate = useDateFormat(startDate, 'MMM DD, YYYY')
|
const formattedDate = useDateFormat(startDate, 'MMM DD, YYYY')
|
||||||
|
|
||||||
const totalHours = usePrecision((stats.value?.coding.grand_total.total_seconds_including_other_language ?? 0) / 3600, 0)
|
|
||||||
|
|
||||||
const topLanguages = computed(() => stats.value?.languages.slice(0, 4) ?? [])
|
const topLanguages = computed(() => stats.value?.languages.slice(0, 4) ?? [])
|
||||||
const topEditors = computed(() => stats.value?.editors.slice(0, 3) ?? [])
|
const topEditors = computed(() => stats.value?.editors.slice(0, 3) ?? [])
|
||||||
const topOS = computed(() => stats.value?.os.slice(0, 2) ?? [])
|
const topOS = computed(() => stats.value?.os.slice(0, 2) ?? [])
|
||||||
@@ -21,8 +20,6 @@ const topOS = computed(() => stats.value?.os.slice(0, 2) ?? [])
|
|||||||
v-if="stats"
|
v-if="stats"
|
||||||
class="space-y-6"
|
class="space-y-6"
|
||||||
>
|
>
|
||||||
{{ stats.coding.range.start }}
|
|
||||||
{{ startDate }}
|
|
||||||
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
|
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
|
||||||
<UCard>
|
<UCard>
|
||||||
<div class="flex items-center gap-4">
|
<div class="flex items-center gap-4">
|
||||||
|
|||||||
Reference in New Issue
Block a user