The Kst date/time code does not use the necessary internationalization and localization functionality from KDE. All dates and times should be output using the libraries, settings, and functionality provided by KDE.
I can't see any behavioural problems with the current code. There are two fixed, non ambiguous formats (at least as far as the menu is concerned), and then two QT internationalized formats. It is important to have these fixed formats, so that the look of a plot can be fixed between locales if wanted. So, I can't imediately see any reason to keep this bug open. If there is a reason, George can re-open with a *specific incorrect behavior*.
On kicker clock, right menu button->Date & Time Format. Set date format to: "DD-MM-YY" and save. Open Kst, with date set to Qt Local Date, or any other date format and plot a curve with the data wizard. Dates are displayed in MM/DD/YYYY, but should be displayed DD-MM-YY. Numeric dates are particularly confusing because it's impossible to know which is the month or day in many cases. The same bug applies to Qt text date, which is why KCalendarSystem is needed.
CVS commit by arwalker: Implement support for KDE formatted dates and times. CCMAIL: 101130-done@bugs.kde.org M +38 -2 kst2dplot.cpp 1.373 M +6 -2 kstplotdefines.h 1.10 --- kdeextragear-2/kst/kst/kst2dplot.cpp #1.372:1.373 @@ -1490,9 +1490,39 @@ void Kst2DPlot::convertJDToDateString(Ks case AXIS_DISPLAY_QTTEXTDATEHHMMSS_SS: date.setYMD(year, month, day); - label.sprintf("%s %02d:%02d:%02.*f", date.toString(Qt::TextDate).ascii(), hour, minute, accuracy, second); + label.sprintf("%s %02d:%02d:%02.*f", date.toString(Qt::TextDate).ascii(), + hour, minute, accuracy, second); break; case AXIS_DISPLAY_QTLOCALDATEHHMMSS_SS: date.setYMD(year, month, day); - label.sprintf("%s %02d:%02d:%02.*f", date.toString(Qt::LocalDate).ascii(), hour, minute, accuracy, second); + label.sprintf("%s %02d:%02d:%02.*f", date.toString(Qt::LocalDate).ascii(), + hour, minute, accuracy, second); + break; + case AXIS_DISPLAY_KDE_SHORTDATE: + label = QString("%1").arg(KGlobal::locale()->formatDateTime( + QDateTime(QDate(year, month, day), + QTime(hour, minute, (int)second)), true, true)); + // + // handle the fractional seconds + // + if (accuracy > 0) { + QString strSecond; + + strSecond.sprintf(" + %0.*f seconds", accuracy, second - floor(second)); + label += strSecond; + } + break; + case AXIS_DISPLAY_KDE_LONGDATE: + label = QString("%1").arg(KGlobal::locale()->formatDateTime( + QDateTime(QDate(year, month, day), + QTime(hour, minute, (int)second)), false, true)); + // + // handle the fractional seconds + // + if (accuracy > 0) { + QString strSecond; + + strSecond.sprintf(" + %0.*f seconds", accuracy, second - floor(second)); + label += strSecond; + } break; default: @@ -1528,4 +1558,6 @@ void Kst2DPlot::convertTimeValueToString case AXIS_DISPLAY_QTTEXTDATEHHMMSS_SS: case AXIS_DISPLAY_QTLOCALDATEHHMMSS_SS: + case AXIS_DISPLAY_KDE_SHORTDATE: + case AXIS_DISPLAY_KDE_LONGDATE: convertJDToDateString(axisInterpretation, axisDisplay, axisTimezoneLocal, axisTimezoneHrs, label, length, value); break; @@ -1570,4 +1602,6 @@ void Kst2DPlot::convertDiffTimevalueToSt case AXIS_DISPLAY_QTTEXTDATEHHMMSS_SS: case AXIS_DISPLAY_QTLOCALDATEHHMMSS_SS: + case AXIS_DISPLAY_KDE_SHORTDATE: + case AXIS_DISPLAY_KDE_LONGDATE: zdiff *= 24.0 * 60.0 * 60.0; break; @@ -1697,4 +1731,6 @@ void Kst2DPlot::genAxisTickLabels(QPaint case AXIS_DISPLAY_QTTEXTDATEHHMMSS_SS: case AXIS_DISPLAY_QTLOCALDATEHHMMSS_SS: + case AXIS_DISPLAY_KDE_SHORTDATE: + case AXIS_DISPLAY_KDE_LONGDATE: if( range > 10.0 * 24.0 * 60.0 * 60.0 ) { scale /= 24.0 * 60.0 * 60.0; --- kdeextragear-2/kst/kst/kstplotdefines.h #1.9:1.10 @@ -42,5 +42,7 @@ enum KstAxisDisplay { AXIS_DISPLAY_JD, AXIS_DISPLAY_MJD, - AXIS_DISPLAY_RJD }; + AXIS_DISPLAY_RJD, + AXIS_DISPLAY_KDE_SHORTDATE, + AXIS_DISPLAY_KDE_LONGDATE }; struct AxisInterpretation { @@ -71,5 +73,7 @@ const AxisDisplay AxisDisplays[] = { { I18N_NOOP2("Julian Date", "JD"), AXIS_DISPLAY_JD }, { I18N_NOOP2("Modified Julian Date", "MJD"), AXIS_DISPLAY_MJD }, - { I18N_NOOP2("Reduced Julian Date", "RJD"), AXIS_DISPLAY_RJD } + { I18N_NOOP2("Reduced Julian Date", "RJD"), AXIS_DISPLAY_RJD }, + { I18N_NOOP("<KDE Short Date and Time>"), AXIS_DISPLAY_KDE_SHORTDATE }, + { I18N_NOOP("<KDE Long Date and Time>"), AXIS_DISPLAY_KDE_LONGDATE } };
Change version to 1.x