Bug 101963 - Year number (used in Taiwan) is not shown correctly after saving file
Summary: Year number (used in Taiwan) is not shown correctly after saving file
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium normal
Assignee: Eike Rathke
URL:
Whiteboard: target:5.3.0 target:5.2.3
Keywords:
Depends on:
Blocks:
 
Reported: 2016-09-07 12:49 UTC by Franklin Weng
Modified: 2016-09-09 11:59 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
Before saving the file (136.77 KB, image/jpeg)
2016-09-07 12:49 UTC, Franklin Weng
Details
After saving the file (135.84 KB, image/jpeg)
2016-09-07 12:50 UTC, Franklin Weng
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Franklin Weng 2016-09-07 12:49:46 UTC
Created attachment 127191 [details]
Before saving the file

1. Set the cell format to date with format string "EE/MM/DD"
2. Input a date like "99/6/13", "2014/9/2", "2016/9/5", and it will show correctly with year number in Taiwan (YYYY-1911) (attached image lo1.jpg)
3. save the file
4. open the file again
5. the format will be changed to "~[ROC]YYYY/MM/DD" and the year number become 0088, 0103, 0105 instead of 88, 103, 105 (attached image lo2.jpg)
Comment 1 Franklin Weng 2016-09-07 12:50:21 UTC
Created attachment 127192 [details]
After saving the file
Comment 2 Franklin Weng 2016-09-07 13:07:42 UTC
Using E/M/D as format does not show this problem.
Comment 3 Eike Rathke 2016-09-07 18:46:50 UTC
When saving to ODF 'EE' is saved as
<number:year number:calendar="ROC" number:style="long"/>
while 'E' is saved as
<number:year number:calendar="ROC"/>
(implied number:style="short")

This when loading creates number format codes YYYY and YY, for which the calendar specific notation of "no leading zero" is not applied.
Cure could be to handle such known calendar switch for specific calendar and locale combinations.
Comment 4 Commit Notification 2016-09-07 19:12:10 UTC
Eike Rathke committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=95c91f098e8974c41c8d403a351fe53db6822165

Resolves: tdf#101963 loading zh-TW ROC calendar use EE|E instead of YYYY|YY

It will be available in 5.3.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 5 Eike Rathke 2016-09-07 19:21:53 UTC
Pending review https://gerrit.libreoffice.org/28732 for 5-2
Comment 6 Commit Notification 2016-09-09 11:59:30 UTC
Eike Rathke committed a patch related to this issue.
It has been pushed to "libreoffice-5-2":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=7f037e2230d059320aff8610b6d24c0a44a71e41&h=libreoffice-5-2

Resolves: tdf#101963 loading zh-TW ROC calendar use EE|E instead of YYYY|YY

It will be available in 5.2.3.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.