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];
|
$customNumberFormat = $customNumberFormats[$numFmtId];
|
||||||
|
|
||||||
|
if ($customNumberFormat === 'General') {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
// Remove extra formatting (what's between [ ], the brackets should not be preceded by a "\")
|
// Remove extra formatting (what's between [ ], the brackets should not be preceded by a "\")
|
||||||
$pattern = '((?<!\\\)\[.+?(?<!\\\)\])';
|
$pattern = '((?<!\\\)\[.+?(?<!\\\)\])';
|
||||||
$customNumberFormat = preg_replace($pattern, '', $customNumberFormat);
|
$customNumberFormat = preg_replace($pattern, '', $customNumberFormat);
|
||||||
|
@ -111,6 +111,7 @@ class StyleHelperTest extends \PHPUnit_Framework_TestCase
|
|||||||
['m/d/yyyy;@', true],
|
['m/d/yyyy;@', true],
|
||||||
['[$-409]m/d/yy\--h:mm;@', true],
|
['[$-409]m/d/yy\--h:mm;@', true],
|
||||||
['GENERAL', false],
|
['GENERAL', false],
|
||||||
|
['General', false],
|
||||||
['\ma\yb\e', false],
|
['\ma\yb\e', false],
|
||||||
['[Red]foo;', false],
|
['[Red]foo;', false],
|
||||||
];
|
];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user