Bug 130563 - Default format for dates should be dd/MM/yyyy for Italian locale
Summary: Default format for dates should be dd/MM/yyyy for Italian locale
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Localization (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium enhancement
Assignee: Eike Rathke
URL:
Whiteboard: target:7.0.0
Keywords:
Depends on:
Blocks:
 
Reported: 2020-02-10 14:50 UTC by Mauro Molinari
Modified: 2020-02-24 17:57 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mauro Molinari 2020-02-10 14:50:51 UTC
Description:
Opened from bug #46448 comment #25.

The default date format for Italian language in all the software I can think of (including Windows and Linux OSes) is dd/MM/yyyy, that is with a four-digit year.
The format dd/MM/yy is seldom used nowadays: it's used when handling legacy electronic devices or specific contexts in which saving two digits in the year can be useful. However, especially since year 2000, using the 4-digit format is largely predominant in all contexts I can think of.

LibreOffice (as well as the original OpenOffice), however, seems to use the dd/MM/yy format by default. Some examples in Calc include:
- typing a date value in a cell, changes its display format to dd/MM/yy (and you have to change it back to dd/MM/yyyy in the cell format settings to get a better result)
- importing CSV data with proper date column setup will make all date columns show in dd/MM/yy format

Searching through the Internet it seems like many people are complaining about this locale setting for the default date format (not only for the Italian locale). The main suggested workaround is to change the cell format for the "Default" style and save it as the new default template, but this breaks proper recognition of plain numbers.

Other similar bug reports: Bug #30821 (where the reporter seems to use the German locale, I suspect the situation is the same), Bug #46448 (which seems to be a larger-scoped enhancement request to allow the user to change some locale-sensitive defaults) and some of the latter duplicates.

Steps to Reproduce:
1. open Calc (ensure the current locale is Italian)
2. create a new spreadsheet using the default template
3. type a date in a cell, like: 10/02/2020
4. hit enter
5. see it be changed to 10/02/20


Actual Results:
The input is correctly recognized as a date, but from a display point of view it's changed to 10/02/20, because the default dd/MM/yy format is applied

Expected Results:
IMHO, if the cell format is "automatic", once a value is recognized as a date, its format should also be recognized and preserved, so that the user is not surprised by a display change.
But this of course would be a whole bigger story.

For simplicity, and consistently with what happens with the other Number cell formats, the default date format should be used to display the date, but this default should dd/MM/yyyy, which is the most commonly used format for dates in Italy (unless you opt for a long format like "20 febbraio 2020", which still uses a 4-digit year anyway).


Reproducible: Always


User Profile Reset: No



Additional Info:
Comment 1 Mike Kaganski 2020-02-10 15:02:22 UTC
https://en.wikipedia.org/wiki/Date_format_by_country seems to confirm that...
Comment 2 Oliver Brinzing 2020-02-10 18:06:30 UTC
I remember reporting it many years ago:

Issue 25942 standard date format not taken from the system properties
https://bz.apache.org/ooo/show_bug.cgi?id=25942
Comment 3 Marina Latini (SUSE) 2020-02-11 06:35:13 UTC
The request sounds legit to me.
@Diego and @Valter: which is your take? I would work on this change moving the default from the year with two digits to the year with four digits.
Comment 4 Mike Kaganski 2020-02-11 07:02:14 UTC
(In reply to Oliver Brinzing from comment #2)
> Issue 25942 standard date format not taken from the system properties
> https://bz.apache.org/ooo/show_bug.cgi?id=25942

Please note that that issue (tdf#73242) is unrelated to this one (which is about LibreOffice internal table of regional defaults).
Comment 5 Marina Latini (SUSE) 2020-02-11 10:33:30 UTC
The list of locales that should be updated with the default from the year with two digits to the year with four digits should be:
1) it_CH
2) it_IT
3) fur_IT
4) lld_IT
5) sc_IT
6) vec_IT

Any other opinion on this?
Patch is ready. I'm just waiting for a feedback from the Italian l10n team
Comment 6 Valter Mura 2020-02-11 11:30:53 UTC
(In reply to Marina Latini (SUSE) from comment #5)
> The list of locales that should be updated with the default from the year
> with two digits to the year with four digits should be:
> 1) it_CH
> 2) it_IT
> 3) fur_IT
> 4) lld_IT
> 5) sc_IT
> 6) vec_IT
> 
> Any other opinion on this?
> Patch is ready. I'm just waiting for a feedback from the Italian l10n team

Hi,

I agree with the change, Marina please proceed.
Comment 7 Eike Rathke 2020-02-11 17:24:37 UTC
@Marina: I assume you're simply swapping the default true/false of formatindex="20" and formatindex="21"?
Comment 8 Mike Kaganski 2020-02-11 18:02:39 UTC
https://gerrit.libreoffice.org/c/core/+/88462
Comment 9 Marina Latini (SUSE) 2020-02-12 09:22:14 UTC
(In reply to Eike Rathke from comment #7)
> @Marina: I assume you're simply swapping the default true/false of
> formatindex="20" and formatindex="21"?

@Eike: I was changing formatindex="18", formatindex="20", formatindex="21", formatindex="46" and formatindex="47".
Three for the DATE usage and two for the DATE_TIME usage.

If my assumptions are wrong I'm happy to edit my patch again.
Comment 10 Marina Latini (SUSE) 2020-02-13 09:37:21 UTC
New amended patch submitted and verified by Jenkins.

As suggested I reverted the changes to formatindex="18" and left only the ones for formatindex="20", formatindex="21".
On formatindex="46" and formatindex="47" I reverted the change to the default waiting to have a better change including the proper support for the years with 4 digits.
Happy to investigate it with you Eike if you think could be something doable for a newbie.

Thanks for your reviews.
Marina
Comment 11 Commit Notification 2020-02-13 14:37:34 UTC
Marina Latini (SUSE) committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/618d1f1085cd7a9c672b851944aae106868266fa

tdf#130563 Change the default dates format for Italian locale

It will be available in 7.0.0.

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

Affected users are encouraged to test the fix and report feedback.
Comment 12 Mauro Molinari 2020-02-14 11:47:55 UTC
I tested the daily at /daily/master/Win-x86_64@tb77-TDF/2020-02-14_08.00.09/, just Calc.
Now the default date format seems to be dd/MM/yyyy, which is what I asked for, thank you!

However, when I enter a date/time value, like "14/02/2020 10:45:13", it gets changed to "14/02/20 10:45" for display purposes... Once again the format with two-digit year!! IMHO this is inconsistent.
Comment 13 Eike Rathke 2020-02-14 22:47:33 UTC
Yes, that is related to what I mentioned in the gerrit review with the DATE_TIME formats at
https://gerrit.libreoffice.org/c/core/+/88462/2/i18npool/source/localedata/data/it_IT.xml#196
Entering a date+time will choose the default DATE_TIME format.

We'll need
a) dd/mm/yyyy hh:mm     format support that can be set as default
and possibly
b) dd/mm/yyyy hh:mm:ss  format to be set if the input includes seconds

As is, there's the predefined formatindex="46" corresponding to the number formatter's NF_DATETIME_SYSTEM_SHORT_HHMM that is used at places to determine default and also mapping in file import, hence we can not simply change the number format code to include the century, or rather I'll have to check first if and how that would be possible or if we need to introduce a separate format.

I can try to solve that minimally invasive in a follow-up change.
Comment 14 Mauro Molinari 2020-02-17 08:21:51 UTC
(In reply to Eike Rathke from comment #13)
> I can try to solve that minimally invasive in a follow-up change.

Hi Eike,
so should this be better reopened or is a new bug report better?
Comment 15 Eike Rathke 2020-02-17 16:31:24 UTC
Reopening and taking to myself.
Comment 16 Commit Notification 2020-02-22 19:18:48 UTC
Eike Rathke committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/8453f6e5d1fd98700a37e30346a1af0daf8fb753

Resolves: tdf#130563 Add predefined 4-digit year date+time format

It will be available in 7.0.0.

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

Affected users are encouraged to test the fix and report feedback.
Comment 17 Mauro Molinari 2020-02-24 09:29:53 UTC
Am I wrong or daily builds at /daily/master/Win-x86_64@tb77-TDF/current/ are still at 2020-02-14?
Comment 18 Eike Rathke 2020-02-24 14:20:59 UTC
tb77 builds have problems, for available builds see https://dev-builds.libreoffice.org/daily/master/current.html
Comment 19 Mauro Molinari 2020-02-24 14:45:05 UTC
(In reply to Eike Rathke from comment #18)
> tb77 builds have problems, for available builds see
> https://dev-builds.libreoffice.org/daily/master/current.html

Still, I can't see anything newer than 2020-02-14 07:59:56 for Windows.
Comment 20 Eike Rathke 2020-02-24 15:04:57 UTC
Yes. But please, the bug tracker is not the place to discuss current infrastructure problems. tb77 is/was the only available box to produce Windows master build full installation packages.
Comment 21 Mauro Molinari 2020-02-24 15:45:11 UTC
(In reply to Eike Rathke from comment #20)
> Yes. But please, the bug tracker is not the place to discuss current
> infrastructure problems. tb77 is/was the only available box to produce
> Windows master build full installation packages.

I do not want to discuss about infrastructure problems, I would just like to test as you requested on comment #16!!

> The patch should be included in the daily builds available at
> https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
> information about daily builds can be found at:
> https://wiki.documentfoundation.org/Testing_Daily_Builds
>
> Affected users are encouraged to test the fix and report feedback.

Otherwise do not ask for testing ;-)
Comment 22 Mike Kaganski 2020-02-24 17:57:28 UTC
(In reply to Mauro Molinari from comment #21)

You could notice it's a message from "Commit Notification", not from Eike; it's an automated standard message. And yes, it's unfortunate that there's no builds available currently to test on Windows (but others could test on other platforms, so the request for testing is not absolutely wrong anyway ;-) ).