Apache OpenOffice (AOO) Bugzilla – Issue 54774
Bad user experience when entering dates in Thai locale
Last modified: 2013-07-30 02:24:36 UTC
In Thailand, the Buddhist calendar is more commonly used than the Gregorian calendar. Year 2005 in the Gregorian calendar is year 2548 in the Buddhist calendar. The Thai locale uses [~buddhist]D/M/YY as the default short date format (formatindex=18). In Calc, if the user enters a date as 19/10/2005, it will by default be displayed as 19/10/48. So far so good. However, if the user now enters a date as 19/10/2548, it will be treated as the year 19/10/2548 in the Gregorian calendar, which is 19/10/3091 in the Buddhist era, and thus be displayed as 19/10/91. The overall result is that by default a Thai user is required all the time to mentally translate between dates in the Buddhist calendar and dates in the Gregorian calendar. Obviously this is not good. The Thai version of Excel has the same problem if a cell uses a Buddhist calendar date format. However, the problem is less serious because by default Excel uses a Gregorian calendar date format, and so the problem will only arise if the user manually chooses a Buddhist calendar date format. There would seem to be two possible approaches: - don't use a Buddhist calendar date format as the default in Calc; however, simply changing the Thai locale data would be problematic because using the Buddhist calendar date format as the default is the right thing to do in other parts of OOo - introduce some intelligence about the calendar with respect to which years are interpreted, rather than always treating dates as being in the Gregorian calendar; this would be analagous to the current intelligence about how two digit date years are entered; for example, interpret dates between 30 and 75 as being between 2530 and 2575 in the Buddhist calendar
Hi James, This is because the th_TH locale data applied with issue 43766 defined Gregorian to be the default calendar. If you changed <Calendar unoid="gregorian" default="true"> ... <Calendar unoid="buddhist" default="false"> to <Calendar unoid="gregorian" default="false"> ... <Calendar unoid="buddhist" default="true"> all date input would be evaluated according to the Buddhist calendar instead. To display Gregorian dates the date format codes would need a leading [~gregorian] calendar switch though. The Tools.Options.OOo.General two digits year could then be set to something around 2500. As a default Buddhist calendar is probably not a thoroughly tested scenario, especially not in applications other than Calc, I suggest to do some testing before finally changing this. I therefore reassign this issue to you to provide adapted and tested locale data, please reassign within the Thai team. Thanks Eike
Reassigning, see last comment. Please provide changed tested locale data and reassign to me when ready.
Hi Eike, I change th_TH locale data follow in your advice. Now I can enter calendar in Buddhist era but I have a problem with number of digit of year section. If I set locale to THAI and set format of cell to 'DD/MM/YYYY'. I enter date in '15/5/48', the output is '15/05/1948' so it wrong. In the others hand, I enter date in '15/5/2548', The output is '15/05/2548' so it right. If I enter 2 digit in Buddhist era, the OOo will recognize year section to 4 digit by try to insert number '19' or '20' at begin of year section. In Buddhist era, OOo should be insert number '25' at begin of year section. Regard, Hin
There's an option you can set under Tools|Options under the OpenOffice.org/General category which says how two digit years should be interpreted. I guess we would need to configure the Thai locale to automatically set that appropriately. Not sure how we do that.
We need to solve the two-digit year problem before we can make the default calendar be Buddhist. See issue 55938.
Reset assignee on issues not touched by assignee in more than 2000 days.