General
should not be interpreted as a date format for number cells (fix issue #212)
This commit is contained in:
parent
e9cd7a397e
commit
33deb10aa7
@ -201,6 +201,10 @@ class StyleHelper
|
||||
|
||||
$customNumberFormat = $customNumberFormats[$numFmtId];
|
||||
|
||||
if ($customNumberFormat === 'General') {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Remove extra formatting (what's between [ ], the brackets should not be preceded by a "\")
|
||||
$pattern = '((?<!\\\)\[.+?(?<!\\\)\])';
|
||||
$customNumberFormat = preg_replace($pattern, '', $customNumberFormat);
|
||||
|
@ -111,6 +111,7 @@ class StyleHelperTest extends \PHPUnit_Framework_TestCase
|
||||
['m/d/yyyy;@', true],
|
||||
['[$-409]m/d/yy\--h:mm;@', true],
|
||||
['GENERAL', false],
|
||||
['General', false],
|
||||
['\ma\yb\e', false],
|
||||
['[Red]foo;', false],
|
||||
];
|
||||
|
Loading…
x
Reference in New Issue
Block a user