isDateTime() now checks for cell value as well as format mask (#919)

* isDateTime() now checks for cell value as well as format mask
This commit is contained in:
Mark Baker 2019-03-06 22:25:00 +01:00 committed by GitHub
parent 9b004b1e6a
commit 432e5845e1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 5 deletions

View File

@ -325,11 +325,12 @@ class Date
*/
public static function isDateTime(Cell $pCell)
{
return self::isDateTimeFormat(
$pCell->getWorksheet()->getStyle(
$pCell->getCoordinate()
)->getNumberFormat()
);
return is_numeric($pCell->getValue()) &&
self::isDateTimeFormat(
$pCell->getWorksheet()->getStyle(
$pCell->getCoordinate()
)->getNumberFormat()
);
}
/**