author | ulf69 <ulf69> | 2004-09-29 01:43:15 (UTC) |
---|---|---|
committer | ulf69 <ulf69> | 2004-09-29 01:43:15 (UTC) |
commit | cd2cb3a9e2ea93909efc9efa16ddd80c2d2b5408 (patch) (side-by-side diff) | |
tree | ab401f13f26d7f72ebd2a53deb3a67e97adad8a1 /microkde | |
parent | af63a131d742aff8e448e5fe0f3e62b11a4d9a33 (diff) | |
download | kdepimpi-cd2cb3a9e2ea93909efc9efa16ddd80c2d2b5408.zip kdepimpi-cd2cb3a9e2ea93909efc9efa16ddd80c2d2b5408.tar.gz kdepimpi-cd2cb3a9e2ea93909efc9efa16ddd80c2d2b5408.tar.bz2 |
needs to be fixed
-rw-r--r-- | microkde/kdecore/klocale.cpp | 30 |
1 files changed, 27 insertions, 3 deletions
diff --git a/microkde/kdecore/klocale.cpp b/microkde/kdecore/klocale.cpp index 4960b9a..7bd8a70 100644 --- a/microkde/kdecore/klocale.cpp +++ b/microkde/kdecore/klocale.cpp @@ -325,24 +325,32 @@ QString KLocale::formatDate(const QDate &pDate, bool shortFormat, IntDateFormat return ret; } QString KLocale::formatDateTime(const QDateTime &pDateTime, bool shortFormat, bool includeSeconds, IntDateFormat intIntDateFormat) const { - return QString( "%1 %2") - .arg( formatDate( pDateTime.date(), shortFormat, intIntDateFormat ) ) + QString format("%1 %2"); + + if ( intIntDateFormat == Default ) + format = "%1 %2"; + else if ( intIntDateFormat == Format1 ) + format = "%1 %2"; + else if ( intIntDateFormat == ISODate ) + format = "%1T%2"; + + return format.arg(formatDate( pDateTime.date(), shortFormat, intIntDateFormat )) .arg( formatTime( pDateTime.time(), includeSeconds , intIntDateFormat ) ); } QString KLocale::formatDateTime(const QDateTime &pDateTime, IntDateFormat intIntDateFormat) const { - return formatDateTime(pDateTime, true, intIntDateFormat); + return formatDateTime(pDateTime, true, true, intIntDateFormat); } QDate KLocale::readDate(const QString &intstr, bool* ok) const { QDate date; date = readDate(intstr, true, ok); if (date.isValid()) return date; return readDate(intstr, false, ok); @@ -565,16 +573,32 @@ QTime KLocale::readTime(const QString &intstr, bool seconds, bool *ok) const error: if (ok) *ok = false; return QTime(-1, -1, -1); // return invalid date if it didn't work // This will be removed in the near future, since it gives a warning on stderr. // The presence of the bool* (since KDE-3.0) removes the need for an invalid QTime. } +QDateTime KLocale::readDateTime(const QString &intstr, + bool shortFormat, + bool includeSeconds, + IntDateFormat intIntDateFormat, + bool* ok) const +{ + bool ok1, ok2; + + QDate m_date = readDate(date, &ok1); + QTime m_time = KGlobal::locale()->readTime(time, &ok2); + if ((ok1 == false) || (ok2 == false)) + qDebug("Serializer::extractMeta invalid date or time !!!!!!!!!!!!!"); + +} + + bool KLocale::use12Clock() const { return !mHourF24Format ;; } bool KLocale::weekStartsMonday() const { return mWeekStartsMonday; |