refactor: date utils and all calls

This commit is contained in:
Julien Froidefond
2025-09-21 11:41:17 +02:00
parent 799a21df5c
commit 557cdebc13
23 changed files with 300 additions and 117 deletions

View File

@@ -1,6 +1,7 @@
'use server';
import { MetricsService, WeeklyMetricsOverview, VelocityTrend } from '@/services/metrics';
import { getToday } from '@/lib/date-utils';
import { revalidatePath } from 'next/cache';
/**
@@ -12,7 +13,7 @@ export async function getWeeklyMetrics(date?: Date): Promise<{
error?: string;
}> {
try {
const targetDate = date || new Date();
const targetDate = date || getToday();
const metrics = await MetricsService.getWeeklyMetrics(targetDate);
return {