formatAsDate strip language metadata (#1618)
* Revert "Fix cant get right format chinese date format error"
This reverts commit 8c58385d6c.
* formatAsDate strip language metadata (fixes #1616)
Co-authored-by: Mark Baker <mark@lange.demon.co.uk>
This commit is contained in:
parent
8d2d78334f
commit
24fb8e61ae
|
|
@ -44,6 +44,7 @@ and this project adheres to [Semantic Versioning](https://semver.org).
|
|||
### Changed
|
||||
|
||||
- Updated the CONVERT() function to support all current MS Excel categories and Units of Measure.
|
||||
- `formatAsDate` correctly matches language metadata, reverting c55272e
|
||||
|
||||
### Deprecated
|
||||
|
||||
|
|
|
|||
|
|
@ -469,7 +469,7 @@ class NumberFormat extends Supervisor
|
|||
// general syntax: [$<Currency string>-<language info>]
|
||||
// language info is in hexadecimal
|
||||
// strip off chinese part like [DBNum1][$-804]
|
||||
$format = preg_replace('/^(\[[0-9A-Za-z]*\])*(\[\$[A-Z]*-[0-9A-F]*\])/i', '', $format);
|
||||
$format = preg_replace('/^(\[DBNum\d\])*(\[\$[^\]]*\])/i', '', $format);
|
||||
|
||||
// OpenOffice.org uses upper-case number formats, e.g. 'YYYY', convert to lower-case;
|
||||
// but we don't want to change any quoted strings
|
||||
|
|
|
|||
|
|
@ -36,22 +36,6 @@ return [
|
|||
22269.0625,
|
||||
'"y-m-d "yyyy-mm-dd" h:m:s "hh:mm:ss',
|
||||
],
|
||||
// Chinese date format
|
||||
[
|
||||
'1960年12月19日',
|
||||
22269.0625,
|
||||
'[DBNum1][$-804]yyyy"年"m"月"d"日";@',
|
||||
],
|
||||
[
|
||||
'1960年12月',
|
||||
22269.0625,
|
||||
'[DBNum1][$-804]yyyy"年"m"月";@',
|
||||
],
|
||||
[
|
||||
'12月19日',
|
||||
22269.0625,
|
||||
'[DBNum1][$-804]m"月"d"日";@',
|
||||
],
|
||||
[
|
||||
'07:35:00 AM',
|
||||
43270.315972222,
|
||||
|
|
@ -77,4 +61,15 @@ return [
|
|||
1.1354166666667,
|
||||
'[h]:mm',
|
||||
],
|
||||
[
|
||||
'19331018',
|
||||
12345.6789,
|
||||
'[DBNum4][$-804]yyyymmdd;@',
|
||||
],
|
||||
// Technically should be 19331018
|
||||
[
|
||||
'19331018',
|
||||
12345.6789,
|
||||
'[DBNum3][$-zh-CN]yyyymmdd;@',
|
||||
],
|
||||
];
|
||||
|
|
|
|||
Loading…
Reference in New Issue