Year 2k-problem is long gone and forgotten, but I would prefer to have dd.mm.yyyy as default format instead of dd.mm.yy So when I enter Strg + ',' (keyboard shortcut for 'insert current date' in german UI) I want appear dd.mm.yyyy instead of dd.mm.yy (also in cells formatted as text). A general solution could be to make the default format used for the date configurable either in tools -> options -> Languages and Locales -> General or in tools -> options -> LibreOffice Calc -> Defaults
I can fully support this wish. It might also be an idea to offer the format generally set by the system for the date as an option.
+1
AFAIK, it needs to be defined in a locale specific definition. And in fact we have "TT.MM.JJ" for DateFormatskey1 in i18npool/source/localedata/data/de_DE.xml. We have four German definitions - and a multitude others. What scope do you have in mind?
(In reply to Heiko Tietze from comment #3) > AFAIK, it needs to be defined in a locale specific definition. And in fact > we have "TT.MM.JJ" for DateFormatskey1 in > i18npool/source/localedata/data/de_DE.xml. We have four German definitions - > and a multitude others. What scope do you have in mind? When I look into de_DE.xml I see 2 FormatElements containing FormatCode TT.MM.JJ one with type="short" and one with type="medium" both with default="true" ... 128 <FormatElement msgid="DateFormatskey1" default="true" type="short" usage="DATE" formatindex="18"> <FormatCode>TT.MM.JJ</FormatCode> </FormatElement> <FormatElement msgid="DateFormatskey9" default="true" type="long" usage="DATE" formatindex="19"> <FormatCode>NNNNT. MMMM JJJJ</FormatCode> </FormatElement> <FormatElement msgid="DateFormatskey8" default="true" type="medium" usage="DATE" formatindex="20"> <FormatCode>TT.MM.JJ</FormatCode> </FormatElement> <FormatElement msgid="DateFormatskey7" default="false" type="medium" usage="DATE" formatindex="21"> 138 <FormatCode>TT.MM.JJJJ</FormatCode> ... I wonder, why there are two different types for TT.MM.JJ. (one 'short' and one 'medium') Perhaps for Writer and not for Calc... Maybe a solution would be to make configurable in the user settings which FormatElement gets the attribute default="true" A quick solution might be to just exchange the default="true"/"false" atrributes between DateFormatskey7 and DateFormatskey8 But I'm not sure if it also matters which FormatElement has msgid DateFormatskey1 IMO it would be preferable in general to default to TT.MM.JJJJ instead of TT.MM.JJ (or some other format containing 4 digits for the year) because this avoids unclearness in printouts (or pdfs). When you have for example 08.09.08 you never know if it's 8. September 1908 or some other millenium...
The msgid attribute is irrelevant. What matters is the combination of the default and type attributes, for each type={short,medium,long} there must be exactly one default=true format, and the default=true type=medium format is used as default display format. The most straight forward change would be to make the formatindex="21" TT.MM.JJJJ format (which is also the edit format) default, i.e. change formatindex="20" from default="true" to default="false" and formatindex="21" from default="false" to default="true". See https://opengrok.libreoffice.org/xref/core/i18npool/source/localedata/data/de_DE.xml?r=b7d53247eb2fab04f5f6d82d405f1ac0c73542b2#134 , and https://opengrok.libreoffice.org/xref/core/i18npool/source/localedata/data/locale.dtd?r=f3811e06b27afcbac7f63c2d184db4b1f8b01a1f#212 for general info on FormatCode elements in a locale data file. However, note that doing so may change the display string in existing documents if the system/current locale's date format was used and not a specific format assigned, which usually is the case, and may come unexpected (and even display ### if the column isn't wide enough). The current practice to use TT.MM.JJ instead of TT.MM.JJJJ in de-DE is the legacy common usage in Germany. > I wonder, why there are two different types for TT.MM.JJ. (one 'short' and one 'medium') Some locales have different format strings for short and medium date formats; we need all formats of indices 0..49 defined for each locale, internally when switching a format between locales without assigning a new format the format with the same index of the target locale is used. Duplicated format codes like de-DE formatindex="18" and formatindex="20" with TT.MM.JJ are eliminated from the dialog's view so you don't even notice there, the highest order "most important" format (here default="true" type="medium" formatindex="20") is presented.