Fix cant get right format chinese date format error
modify preg expression in NumberFormat.php [DBNum1][$-804]yyyy"年"m"月"d"日";@ [DBNum1][$-804]yyyy"年"m"月";@ [DBNum1][$-804]m"月"d"日";@ FIX #44
This commit is contained in:
parent
939f24ecb4
commit
8c58385d6c
|
@ -464,7 +464,8 @@ class NumberFormat extends Supervisor implements \PhpOffice\PhpSpreadsheet\IComp
|
||||||
// strip off first part containing e.g. [$-F800] or [$USD-409]
|
// strip off first part containing e.g. [$-F800] or [$USD-409]
|
||||||
// general syntax: [$<Currency string>-<language info>]
|
// general syntax: [$<Currency string>-<language info>]
|
||||||
// language info is in hexadecimal
|
// language info is in hexadecimal
|
||||||
$format = preg_replace('/^(\[\$[A-Z]*-[0-9A-F]*\])/i', '', $format);
|
// strip off chinese part like [DBNum1][$-804]
|
||||||
|
$format = preg_replace('/^(\[[0-9A-Za-z]*\])*(\[\$[A-Z]*-[0-9A-F]*\])/i', '', $format);
|
||||||
|
|
||||||
// OpenOffice.org uses upper-case number formats, e.g. 'YYYY', convert to lower-case;
|
// OpenOffice.org uses upper-case number formats, e.g. 'YYYY', convert to lower-case;
|
||||||
// but we don't want to change any quoted strings
|
// but we don't want to change any quoted strings
|
||||||
|
|
|
@ -36,4 +36,20 @@ return [
|
||||||
'"y-m-d "yyyy-mm-dd" h:m:s "hh:mm:ss',
|
'"y-m-d "yyyy-mm-dd" h:m:s "hh:mm:ss',
|
||||||
'y-m-d 1960-12-19 h:m:s 01:30:00',
|
'y-m-d 1960-12-19 h:m:s 01:30:00',
|
||||||
],
|
],
|
||||||
|
// Chinese date format
|
||||||
|
[
|
||||||
|
22269.0625,
|
||||||
|
'[DBNum1][$-804]yyyy"年"m"月"d"日";@',
|
||||||
|
'1960年12月19日',
|
||||||
|
],
|
||||||
|
[
|
||||||
|
22269.0625,
|
||||||
|
'[DBNum1][$-804]yyyy"年"m"月";@',
|
||||||
|
'1960年12月',
|
||||||
|
],
|
||||||
|
[
|
||||||
|
22269.0625,
|
||||||
|
'[DBNum1][$-804]m"月"d"日";@',
|
||||||
|
'12月19日',
|
||||||
|
],
|
||||||
];
|
];
|
||||||
|
|
Loading…
Reference in New Issue