réorganiser les patches
This commit is contained in:
parent
4407af5dcd
commit
85e9740971
33
patches/v4.27.0-000-date-format.patch
Normal file
33
patches/v4.27.0-000-date-format.patch
Normal file
@ -0,0 +1,33 @@
|
||||
diff --git a/src/Reader/XLSX/Helper/CellValueFormatter.php b/src/Reader/XLSX/Helper/CellValueFormatter.php
|
||||
index 776de0a..bc7a5c4 100644
|
||||
--- a/src/Reader/XLSX/Helper/CellValueFormatter.php
|
||||
+++ b/src/Reader/XLSX/Helper/CellValueFormatter.php
|
||||
@@ -284,9 +284,13 @@ final class CellValueFormatter
|
||||
\assert(false !== $dateObj);
|
||||
|
||||
if ($this->shouldFormatDates) {
|
||||
- $styleNumberFormatCode = $this->styleManager->getNumberFormatCode($cellStyleId);
|
||||
- $phpDateFormat = DateFormatHelper::toPHPDateFormat($styleNumberFormatCode);
|
||||
+ //$styleNumberFormatCode = $this->styleManager->getNumberFormatCode($cellStyleId);
|
||||
+ //$phpDateFormat = DateFormatHelper::toPHPDateFormat($styleNumberFormatCode);
|
||||
+ // Toujours utiliser le format français complet
|
||||
+ $phpDateFormat = "d/m/Y H:i:s";
|
||||
$cellValue = $dateObj->format($phpDateFormat);
|
||||
+ // Enlever la composante heure si elle n'existe pas
|
||||
+ $cellValue = preg_replace('/ 00:00:00$/', "", $cellValue);
|
||||
} else {
|
||||
$cellValue = $dateObj;
|
||||
}
|
||||
diff --git a/src/Reader/XLSX/Options.php b/src/Reader/XLSX/Options.php
|
||||
index 636d2a4..e8609b5 100644
|
||||
--- a/src/Reader/XLSX/Options.php
|
||||
+++ b/src/Reader/XLSX/Options.php
|
||||
@@ -10,7 +10,7 @@ final class Options
|
||||
{
|
||||
use TempFolderOptionTrait;
|
||||
|
||||
- public bool $SHOULD_FORMAT_DATES = false;
|
||||
+ public bool $SHOULD_FORMAT_DATES = true;
|
||||
public bool $SHOULD_PRESERVE_EMPTY_ROWS = false;
|
||||
public bool $SHOULD_USE_1904_DATES = false;
|
||||
public bool $SHOULD_LOAD_MERGE_CELLS = false;
|
@ -1,36 +1,3 @@
|
||||
diff --git a/src/Reader/XLSX/Helper/CellValueFormatter.php b/src/Reader/XLSX/Helper/CellValueFormatter.php
|
||||
index 776de0a..bc7a5c4 100644
|
||||
--- a/src/Reader/XLSX/Helper/CellValueFormatter.php
|
||||
+++ b/src/Reader/XLSX/Helper/CellValueFormatter.php
|
||||
@@ -284,9 +284,13 @@ final class CellValueFormatter
|
||||
\assert(false !== $dateObj);
|
||||
|
||||
if ($this->shouldFormatDates) {
|
||||
- $styleNumberFormatCode = $this->styleManager->getNumberFormatCode($cellStyleId);
|
||||
- $phpDateFormat = DateFormatHelper::toPHPDateFormat($styleNumberFormatCode);
|
||||
+ //$styleNumberFormatCode = $this->styleManager->getNumberFormatCode($cellStyleId);
|
||||
+ //$phpDateFormat = DateFormatHelper::toPHPDateFormat($styleNumberFormatCode);
|
||||
+ // Toujours utiliser le format français complet
|
||||
+ $phpDateFormat = "d/m/Y H:i:s";
|
||||
$cellValue = $dateObj->format($phpDateFormat);
|
||||
+ // Enlever la composante heure si elle n'existe pas
|
||||
+ $cellValue = preg_replace('/ 00:00:00$/', "", $cellValue);
|
||||
} else {
|
||||
$cellValue = $dateObj;
|
||||
}
|
||||
diff --git a/src/Reader/XLSX/Options.php b/src/Reader/XLSX/Options.php
|
||||
index 636d2a4..e8609b5 100644
|
||||
--- a/src/Reader/XLSX/Options.php
|
||||
+++ b/src/Reader/XLSX/Options.php
|
||||
@@ -10,7 +10,7 @@ final class Options
|
||||
{
|
||||
use TempFolderOptionTrait;
|
||||
|
||||
- public bool $SHOULD_FORMAT_DATES = false;
|
||||
+ public bool $SHOULD_FORMAT_DATES = true;
|
||||
public bool $SHOULD_PRESERVE_EMPTY_ROWS = false;
|
||||
public bool $SHOULD_USE_1904_DATES = false;
|
||||
public bool $SHOULD_LOAD_MERGE_CELLS = false;
|
||||
diff --git a/src/Writer/AbstractWriter.php b/src/Writer/AbstractWriter.php
|
||||
index eef34fb..a22e90f 100644
|
||||
--- a/src/Writer/AbstractWriter.php
|
40
patches/v4.27.0-002-page_order.patch
Normal file
40
patches/v4.27.0-002-page_order.patch
Normal file
@ -0,0 +1,40 @@
|
||||
diff -urN a/src/Writer/XLSX/Helper/FileSystemHelper.php b/src/Writer/XLSX/Helper/FileSystemHelper.php
|
||||
--- a/src/Writer/XLSX/Helper/FileSystemHelper.php 2025-03-04 12:07:12.938528783 +0400
|
||||
+++ b/src/Writer/XLSX/Helper/FileSystemHelper.php 2024-11-30 15:32:06.000000000 +0400
|
||||
@@ -517,6 +517,10 @@
|
||||
$xml .= " paperSize=\"{$pageSetup->paperSize->value}\"";
|
||||
}
|
||||
|
||||
+ if (null !== $pageSetup->pageOrder) {
|
||||
+ $xml .= " pageOrder=\"{$pageSetup->pageOrder->value}\"";
|
||||
+ }
|
||||
+
|
||||
if (null !== $pageSetup->fitToHeight) {
|
||||
$xml .= " fitToHeight=\"{$pageSetup->fitToHeight}\"";
|
||||
}
|
||||
diff -urN a/src/Writer/XLSX/Options/PageOrder.php b/src/Writer/XLSX/Options/PageOrder.php
|
||||
--- a/src/Writer/XLSX/Options/PageOrder.php 1970-01-01 04:00:00.000000000 +0400
|
||||
+++ b/src/Writer/XLSX/Options/PageOrder.php 2024-11-30 15:32:06.000000000 +0400
|
||||
@@ -0,0 +1,11 @@
|
||||
+<?php
|
||||
+
|
||||
+declare(strict_types=1);
|
||||
+
|
||||
+namespace OpenSpout\Writer\XLSX\Options;
|
||||
+
|
||||
+enum PageOrder: string
|
||||
+{
|
||||
+ case DOWN_THEN_OVER = 'downThenOver';
|
||||
+ case OVER_THEN_DOWN = 'overThenDown';
|
||||
+}
|
||||
diff -urN a/src/Writer/XLSX/Options/PageSetup.php b/src/Writer/XLSX/Options/PageSetup.php
|
||||
--- a/src/Writer/XLSX/Options/PageSetup.php 2025-03-04 12:07:12.938528783 +0400
|
||||
+++ b/src/Writer/XLSX/Options/PageSetup.php 2024-11-30 15:32:06.000000000 +0400
|
||||
@@ -13,6 +13,7 @@
|
||||
public ?PaperSize $paperSize,
|
||||
public ?int $fitToHeight = null,
|
||||
public ?int $fitToWidth = null,
|
||||
+ public ?PageOrder $pageOrder = null,
|
||||
) {
|
||||
$this->fitToPage = null !== $fitToHeight || null !== $fitToWidth;
|
||||
}
|
Loading…
Reference in New Issue
Block a user