Bug 95339 - userdefined 'Format-Code' doesn't work as expected when using "mm" ...
Summary: userdefined 'Format-Code' doesn't work as expected when using "mm" ...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: Other All
: medium normal
Assignee: Laurent Balland
URL:
Whiteboard: target:5.2.0 target:5.1.4 target:5.3.0
Keywords:
Depends on:
Blocks:
 
Reported: 2015-10-26 20:10 UTC by dhn
Modified: 2016-10-25 18:54 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
Example file with comments (16.00 KB, application/vnd.ms-excel)
2015-10-30 17:35 UTC, dhn
Details

Note You need to log in before you can comment on or make changes to this bug.
Description dhn 2015-10-26 20:10:28 UTC
User-Agent:       Mozilla/5.0 (Windows NT 6.1; rv:41.0) Gecko/20100101 Firefox/41.0
Build Identifier: LibreOffice 5.0.1.2 (WIN) && 4.3.7.2 (LINUX)

[Intro: English isn't my native language && I don't know the correct descriptions/menue entries as I use the german Version!]
 
If I want to give a cell a 'special' format based on the function `=JETZT()` (NOW??) the result isn't as expected nor is it as written in LibreOffice-Help.
 
I want to give the cell the (german!) format "JJMMTT-ssmm" which _should_ be
YEAR-MONTH-DAY--SECOND-MINUTE the result ist *always* YEAR-MONTH-DAY--SECOND-MONTH !!??
(plz don't ask WTF/WTH ... -- it is required for an "identifier" of an report!)

Reproducible: Always

Steps to Reproduce:
NN  (see above!?)

(happens under Windows && happens under Linux)


Expected Results:  
As I know that "... it is working in E****!" doesn't mean that E**** is always working correct: IMHO is this something that /should/ be corrected (for the need of interoperability?). Especially as HELP shows
...minutes as   0-59 m
...minutes as  00-59 mm
...seconds as   0-59 s
...seconds as  00-59 ss

[Information automatically included from LibreOffice]
Locale: de
Module: SpreadsheetDocument
[Information guessed from browser]
OS: Windows (All)
OS is 64bit: no


Reset User Profile?No
Comment 1 Joel Madero 2015-10-30 04:05:51 UTC
Please attach a sample document and then set the bug back to UNCONFIRMED. Thanks

Also exclamation marks, WTF, etc... are entirely unhelpful and don't motivate anyone to work on your bug. Personal suggestion is to refrain from the extraneous punctuation/words and just stick to the issue in a clear and concise manner. Thanks
Comment 2 dhn 2015-10-30 17:35:18 UTC
Created attachment 120116 [details]
Example file with comments
Comment 3 GerardF 2015-10-30 20:25:52 UTC
Not specific to German but for all locales having twice the M code (for month and minute). Pretty all "Latin alphabet" language except Finnish...

Happens when "mm" is not preceded by "hh" or followed by "ss".

Surprisingly DDMMYY-SS[MM] showd the minutes (not month) but unfortunely show also the brackets...
Comment 4 dhn 2016-02-10 20:18:21 UTC
Additional info:

~~~~~~~~~~~~~~~
Version: 5.1.0.3
Build-ID: 5e3e00a007d9b3b6efb6797a8b8e57b51ab1f737
CPU Threads: 4; OS Version: Windows 6.2; UI Render: default; 
Gebietsschema: de-DE (de_DE)
~~~~~~~~~~~~~~~

Problem still exists.

--
Greetings from
Germany
Comment 5 Laurent Balland 2016-05-01 10:21:37 UTC
(In reply to GerardF from comment #3)
> Not specific to German but for all locales having twice the M code (for
> month and minute). Pretty all "Latin alphabet" language except Finnish...
> 
> Happens when "mm" is not preceded by "hh" or followed by "ss".

That's right. Simply enter mm as format, and it is recognized as month and not minutes.

Simplest steps to reproduce:
1. Format > Cells > Number
2. Enter mm as format
3. OK
4. Format > Cells > Number

Actual behavior:
Format has been changed to MM

Expected behavior:
Format should be kept to what user entered mm
Comment 6 Laurent Balland 2016-05-01 11:00:20 UTC
Code pointer:
http://opengrok.libreoffice.org/xref/core/svl/source/numbers/zforscan.cxx#ScanType
It seems that same key is used for M or m and MM or mm.
Comment 7 Commit Notification 2016-05-25 10:40:06 UTC
Laurent Balland-Poirier committed a patch related to this issue.
It has been pushed to "master":

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

tdf#95339 Extend test to distinguish minute/month

It will be available in 5.2.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 8 Commit Notification 2016-05-25 15:44:35 UTC
Laurent Balland-Poirier committed a patch related to this issue.
It has been pushed to "libreoffice-5-1":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=d31f8efabd895ae0f14ae64e6caf1cfc78bf53a5&h=libreoffice-5-1

tdf#95339 Extend test to distinguish minute/month

It will be available in 5.1.4.

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 9 Commit Notification 2016-05-30 22:53:05 UTC
Laurent Balland-Poirier committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=93874236610dd50a46b6db229e022ae364af582a

tdf#97835 tdf#61996 tdf#95339 Add qa unit test

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.