mirror of
https://github.com/PHPOffice/PhpSpreadsheet.git
synced 2026-10-08 12:56:39 +00:00
Refactor ISO data type validation from cell to shared date; add extra checks for invalid dates; and appropriate unit tests
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
<?php
|
||||
|
||||
use PhpOffice\PhpSpreadsheet\Calculation\Information\ExcelError;
|
||||
use PhpOffice\PhpSpreadsheet\Cell\DataType;
|
||||
|
||||
return [
|
||||
@@ -39,12 +40,27 @@ return [
|
||||
DataType::TYPE_NUMERIC,
|
||||
],
|
||||
[
|
||||
'#DIV/0!',
|
||||
44613.43090277778,
|
||||
'2022-02-21 10:20:30',
|
||||
DataType::TYPE_ISO_DATE,
|
||||
],
|
||||
[
|
||||
44613.0,
|
||||
'2022-02-21',
|
||||
DataType::TYPE_ISO_DATE,
|
||||
],
|
||||
[
|
||||
-30879.0,
|
||||
'1815-06-15', // Dates outside the Excel Range should fail really
|
||||
DataType::TYPE_ISO_DATE,
|
||||
],
|
||||
[
|
||||
ExcelError::DIV0(),
|
||||
'#DIV/0!',
|
||||
DataType::TYPE_ERROR,
|
||||
],
|
||||
[
|
||||
'#NULL!',
|
||||
ExcelError::null(),
|
||||
'NOT A VALID ERROR TYPE VALUE',
|
||||
DataType::TYPE_ERROR,
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user