-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Closed
Description
This is:
- [ X ] a bug report
- [ ] a feature request
- [ ] **not** a usage question (ask them on https://stackoverflow.com/questions/tagged/phpspreadsheet or https://gitter.im/PHPOffice/PhpSpreadsheet)
What is the expected behavior?
When I pass as first parameter excelTimestamp a value different from int or float I expect an InvalidArgumentException
What is the current behavior?
Method try to extract the number of days from wrong value provided and use it in $baseDate->modify($interval)->setTime($hours, $minutes, $seconds); but modify return false and concatenate method call raise a fatal error.
What are the steps to reproduce?
Please provide a Minimal, Complete, and Verifiable example of code that exhibits the issue without relying on an external Excel file or a web server:
<?php
require __DIR__ . '/vendor/autoload.php';
// Create new Spreadsheet object
$spreadsheet = new \PhpOffice\PhpSpreadsheet\Spreadsheet();
// add code that show the issue here...
$worksheet = $spreadSheet->createSheet();
$worksheet->setCellValueByColumnAndRow('A', 1, '5e8630b8-603c-43fe-b038-6154a3f893ab');
$cell = $worksheet->getCell('A1');
$cell->setValue('5e8630b8-603c-43fe-b038-6154a3f893ab');
$cell->getStyle()
->getNumberFormat()->setFormatCode('m/d/yyyy');
if(\PhpOffice\PhpSpreadsheet\Shared\Date::isDateTime($cell)) {
$datetime = \PhpOffice\PhpSpreadsheet\Shared\Date::excelToDateTimeObject($cell->getValue());
}Which versions of PhpSpreadsheet and PHP are affected?
1.6.0
Metadata
Metadata
Assignees
Labels
No labels