Date format in Digital Clock applet

John Layt johnlayt at googlemail.com
Sat Oct 17 02:25:43 CEST 2009


There's a number of bugs accumulating for the formatting of the date in the 
Digital Clock, most of which are dupes which I'll close:

https://bugs.kde.org/show_bug.cgi?id=162368
https://bugs.kde.org/show_bug.cgi?id=195837
https://bugs.kde.org/show_bug.cgi?id=197776
https://bugs.kde.org/show_bug.cgi?id=209266

The primary issue is that the current formatting code does not allow for 
proper i18n and possibly l10n, i.e. it neither formats nor translates properly 
based on your locale, the layout is too rigid with each component being 
processed separately and not combining properly.  This especially affects our 
American friends with their backwards dates :-)

The most vocal users seem to simply want the global locale format to be used, 
perhaps with the choice of long or short format.  However I'm aware that we 
should continue to provide the ability to choose a different format due to 
space, readability and redundancy issues (who really needs the year?), all 
whilst continuing to keep the config gui as simple as possible.  We don't want 
to add a radio button for 'Backwards American Format'

Note that for the time format we do use the global format and don't allow 
customisation except for 'Display Seconds'.

Possible solutions:

1) Simplest option, leave config gui as is, make code smarter by trying to 
guess at which way around days/months should be by looking at the global 
format, and fix any l10n issues that remain.  The ISO format could prove a 
problem when guessing, nor would country be reliable indicator.

2) Remove the 'Show Date' tick-box and add a combo box to allow users to 
choose between 'No Date', 'Default Format', 'Default Short Format', or 
'Custom'.  Leave the current tick-boxes for selecting the format.  This still 
relies on some code to guess the right format.

3) Do 2) but instead of the radio buttons provide editable format combo boxes 
as in System Settings.  I don't like the usability of the existing combos, 
they're too complex, rely on arcane knowledge, are not at all intuitive, and 
you can actually type in invalid formats and break everything.

4) Do 2) but instead of the radio buttons just add a few select supported 
formats to the combo in place of 'Custom'.  These could be plain English 
descriptions or examples using today's date rather than actual format strings.  
Simple, but limits users options, essentially option 2) but without the radio 
buttons and any guessing at right day/month order.

5) Do 2) but borrow from Apple who do a really nice config gui for date and 
time formats (see 
http://www.layt.net/john/galleries/technology/kde/osx_date_format_config_gui).  
Basically it gives you a palette of the different date or time components in 
long/short/word/number versions and you drag them onto a line in the order you 
want.  Not something I think I can code up, but this would be great in System 
Settings as well.

Personally I think 4 sounds the best for now from the viewpoint of keeping it 
simple but still allowing some choice.  If anyone wants to have a go at 5) for 
System Settings for Date and Time formats that would be super :-)

Would we also want to do the same for the time format, i.e. allow the users to 
choose for each clock whether it's global, 24hr, or am/pm formatting using a 
combo?

Cheers!

John.

P.S. As an aside, I have seen it suggested we could have separate formats in 
KLocale for input and output date formats, e.g. to require 4 digit years on 
input but allow 2 digit years on display.  Anyone see any benefit in that?


More information about the Plasma-devel mailing list