Page 1 of 1

Override the Document Locale Date Format

PostPosted: Mon Jan 07, 2013 9:24 am
by Llelan D.
There are many threads about formatting Date fields, but what I want to do is to override the date format for the current locale.

In many cases with historical or international documents, the locale is fine for number and currency formats but not for the date. An author might choose from many different flavors of date format available in their locale, a format they are used to from another locale, or an international format (like UTC). There are many AOO functions and extensions that insert dates and allow the default AOO locale processing to format them. This sticks you with the locale format and not the one you want for that document. An example would by the Mendeley citation manager inserting a date into a bibliography entry. The date is always formatted as per the currently set locale for the document.

So, what I want to know is: how do I change the default date format for a specific Writer document for a given locale so that everything else is formatted by that locale but any dates given to AOO by any other code or extension is formatted by the overridden date format for that document?

Remember, this has nothing to do with manual insertion of dates or date fields, nor with any other application but Writer (not Calc!).

Re: Override the Document Locale Date Format

PostPosted: Mon Jan 07, 2013 9:36 am
by Villeroy
Use the language list on the right side of the number format dialog to override the default locale.

Re: Override the Document Locale Date Format

PostPosted: Mon Jan 07, 2013 10:20 am
by Llelan D.
:roll: The Number Format Dialog is only available for table cells and Fields - and I put in all of that lovely text specifically stating that this problem has nothing to do with Date Fields.

When an extension hands a date to AOO to be formatted and inserted into a document, it is inserted as plain text. There is no Number Format Dialog available for a span of plain text. Besides, even if such a function were available, it does not address my stated problem which is to override the document default locale date format, not manually patch inserted date formats.

An extension can not format something like a date since that depends on how the document is configured. It must allow the document software, in this case Writer, to perform the format and insertion. This means AOO has to have a way to specify the locale for that document, which it does, and any document overrides to that locale formatting, which is for what I am looking in relation to date formatting.

Unless you are cryptically referring to some other function unknown to me. In which case, could you be more specific as I do not know of any other way to get a Number Format Dialog outside of the context menu for table cells or a Date Field.