refactor: unify date handling with utility functions
- Replaced direct date manipulations with utility functions like `getToday`, `parseDate`, and `createDateFromParts` across various components and services for consistency. - Updated date initialization in `JiraAnalyticsService`, `BackupService`, and `DailyClient` to improve clarity and maintainability. - Enhanced date parsing in forms and API routes to ensure proper handling of date strings.
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
*/
|
||||
|
||||
import { JiraAnalytics, SprintVelocity, CycleTimeByType, AssigneeWorkload } from '@/lib/types';
|
||||
import { getToday } from '@/lib/date-utils';
|
||||
|
||||
export interface JiraAnomaly {
|
||||
id: string;
|
||||
@@ -44,7 +45,7 @@ export class JiraAnomalyDetectionService {
|
||||
*/
|
||||
async detectAnomalies(analytics: JiraAnalytics): Promise<JiraAnomaly[]> {
|
||||
const anomalies: JiraAnomaly[] = [];
|
||||
const timestamp = new Date().toISOString();
|
||||
const timestamp = getToday().toISOString();
|
||||
|
||||
// 1. Détection d'anomalies de vélocité
|
||||
const velocityAnomalies = this.detectVelocityAnomalies(analytics.velocityMetrics, timestamp);
|
||||
|
||||
Reference in New Issue
Block a user