diff --git a/patches/v4.27.0-000-date-format.patch b/patches/v4.27.0-000-date-format.patch new file mode 100644 index 0000000..bc6a0bd --- /dev/null +++ b/patches/v4.27.0-000-date-format.patch @@ -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; diff --git a/patches/v4.27.0.patch b/patches/v4.27.0-001-file_pointer.patch similarity index 53% rename from patches/v4.27.0.patch rename to patches/v4.27.0-001-file_pointer.patch index 1be50ce..c6e4091 100644 --- a/patches/v4.27.0.patch +++ b/patches/v4.27.0-001-file_pointer.patch @@ -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 diff --git a/patches/v4.27.0-002-page_order.patch b/patches/v4.27.0-002-page_order.patch new file mode 100644 index 0000000..eaa1c9d --- /dev/null +++ b/patches/v4.27.0-002-page_order.patch @@ -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 @@ ++fitToPage = null !== $fitToHeight || null !== $fitToWidth; + }