PhpSpreadsheet/docs/topics
oleibman e4e99b8a73
Permit Date/Time Entered on Spreadsheet to be Calculated as Float (#3121)
* Permit Date/Time Entered on Spreadsheet to be Calculated as Float

Fix #1416. I do not entirely understand the use case for this old issue, but resolving it seems straightforward. Issue complains that user-entered date/time fields may be interpreted as either float or int when PhpSpreadsheet reads them. Issue suggests getCalculatedValue treat all date/time fields as float; that seems like a breaking change. However, adding an option to permit it seems okay. That option might be implemented as either a property of Calculation, or a static property of Cell. Since the changed logic is found in Cell (and Shared/Date), I opted for the latter.

In Cell, the property `$parent` is incorrectly described in doc block as `Cells`, and should be `?Cells`. This change eliminates some Phpstan and Scrutinizer problems, and should allow the elimination of some try/catch blocks - I have not done an exhaustive search for those.

Calls to `isDateTime` could have affected activeSheet and selectedCells; they no longer can. Optional parameters are added to it and the functions it calls to accommodate the new functionality; the defaults for the new parameters will, of course, return the same result as the earlier versions of the functions would have returned.

* Scrutinizer - Self-inflicted

Tests used constant which I deprecated.
2022-10-18 18:58:38 -07:00
..
images Handle additional merge options like those provide in OpenOffice or LibreOffice to hide cell values in a merge range rather than empty them, or to merge the values as well as the cells 2022-09-15 21:07:31 +02:00
accessing-cells.md Make CSV Reader boolean casting (e.g. string ``"TRUE"` to boolean `TRUE`) locale-aware. 2022-02-27 23:06:22 +01:00
architecture.md Code highlight in docs for PhpStorm 2020-05-31 22:44:25 +09:00
autofilters.md Xlsx Writer Unhides Explicitly Hidden Row in Filter Range - Minor Breaking Change (#2414) 2021-12-05 07:26:24 -08:00
calculation-engine.md Permit Date/Time Entered on Spreadsheet to be Calculated as Float (#3121) 2022-10-18 18:58:38 -07:00
conditional-formatting.md Correct fill color example in conditional formatting docs. (#2646) 2022-03-04 01:41:21 -08:00
creating-spreadsheet.md Code highlight in docs for PhpStorm 2020-05-31 22:44:25 +09:00
defined-names.md Named formula implementation, and improved handling of Defined Names generally (#1535) 2020-07-26 12:00:06 +02:00
file-formats.md Allow Reader format identification to use a subset of possible Readers 2022-04-19 14:24:53 +02:00
memory_saving.md Documentation updates (#2131) 2021-05-30 12:27:56 +02:00
migration-from-PHPExcel.md Update excel migration with sets() method (#2861) 2022-05-31 07:19:43 -07:00
reading-and-writing-to-file.md Document Charset Restriction for Html/Xml Reader (#3068) 2022-09-19 06:49:01 -07:00
reading-files.md Allow Reader format identification to use a subset of possible Readers 2022-04-19 14:24:53 +02:00
recipes.md Handle additional merge options like those provide in OpenOffice or LibreOffice to hide cell values in a merge range rather than empty them, or to merge the values as well as the cells 2022-09-15 21:07:31 +02:00
settings.md WEBSERVICE is HTTP client agnostic 2020-07-19 11:33:01 +09:00
worksheets.md Code highlight in docs for PhpStorm 2020-05-31 22:44:25 +09:00