cilog-lib 1.13.20 → 1.13.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -501,19 +501,14 @@ class ExportService {
501
501
  });
502
502
  const activeColumns = columns.filter(col => !col.invisible && (!byFiltre || col.exportable === true));
503
503
  // Génération des colonnes Excel
504
- let cols = [];
505
- activeColumns.forEach(col => {
506
- let colExcel = {
507
- header: col.libelle,
508
- key: col.id,
509
- style: this.getStyleByType(col.type)
510
- };
511
- if (col.width != null && col.width.toString().includes('px')) {
512
- const px = parseInt(col.width.toString().replace('px', '').trim(), 10);
513
- colExcel.width = parseFloat((px / 7).toFixed(2));
514
- }
515
- cols.push(colExcel);
516
- });
504
+ let cols = activeColumns.map(col => ({
505
+ header: col.libelle,
506
+ key: col.id,
507
+ style: this.getStyleByType(col.type),
508
+ width: col.width != null
509
+ ? Math.max(parseFloat((parseInt(col.width.toString().replace('px', ''), 10) / 7.5).toFixed(2)), 12)
510
+ : Math.max(col.libelle ? col.libelle.length + 5 : 12, 12)
511
+ }));
517
512
  ws.columns = cols;
518
513
  const activeRows = byFiltre ? values.filter(row => row.exportable === true) : values;
519
514
  // Traitement des lignes
@@ -643,9 +638,13 @@ class ExportService {
643
638
  case ColType.Switch:
644
639
  return cell.value === true ? 'Oui' : 'Non';
645
640
  case ColType.Date:
646
- // Correction du parsing de date plus propre
647
- const d = new Date(cell.value);
648
- return isNaN(d.getTime()) ? null : d;
641
+ if (!cell.value)
642
+ return null;
643
+ const d = cell.value instanceof Date ? cell.value : new Date(cell.value);
644
+ if (isNaN(d.getTime()))
645
+ return null;
646
+ const safeDate = new Date(d.getTime() + 12 * 60 * 60 * 1000);
647
+ return new Date(safeDate.getFullYear(), safeDate.getMonth() + 1, safeDate.getDate(), 12, 0, 0);
649
648
  default:
650
649
  return cell.value;
651
650
  }