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

@@ -3,6 +3,7 @@ import { exec } from 'child_process';
import { promisify } from 'util';
import path from 'path';
import { createHash } from 'crypto';
import { formatDateForDisplay, getToday } from './date-utils';
const execAsync = promisify(exec);
@@ -184,7 +185,7 @@ export class BackupUtils {
extra?: { hash?: string; size?: number; previousHash?: string }
): Promise<void> {
try {
const date = new Date().toLocaleString('fr-FR');
const date = formatDateForDisplay(getToday(), 'DISPLAY_LONG');
let logEntry = `[${date}] ${type.toUpperCase()} BACKUP ${action.toUpperCase()}: ${details}`;